Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8536033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:34:17+00:00 2026-06-11T10:34:17+00:00

Hi in Paypal after transaction the amount should be stored in database.but decimal amount

  • 0

Hi in Paypal after transaction the amount should be stored in database.but decimal amount is not storing in the database it convert into whole number.i want to store it in database as decimal number.

for example:amt = 0.5 it storing in MySQL database as 1.i want to store it in database as 0.5

can anyone help me how to do with query.

thanks in advance.

i m new to Paypal and MySQL.if any mistake in my question please fg.

This is my Code

       <?php
        define("DB_HOST", "localhost");
          define("DB_USERNAME", "root");
          define("DB_PASSWORD", "");
           define("DB_DATABASE", "test");
          $connect = mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD) or die("Database Connection Error");
          mysql_select_db(DB_DATABASE) or ("Database Selection Error");

          session_start();
         $uid = $_SESSION['uid'];
          $username=$_SESSION['username'];

          $item_no = isset($_GET['item_number']) ? $_GET['item_number'] : null;
           $item_transaction = isset($_GET['tx']) ? $_GET['tx'] : null ;
                $item_price = isset($_GET['amt']) ? $_GET['amt'] : null ;
             $item_currency = isset($_GET['cc']) ? $_GET['cc'] : null ;;

           $result = mysql_query("INSERT INTO sales(pid, uid, saledate,transactionid,amt) VALUES('$item_no', '$uid', NOW(),'$item_transaction','$item_price')");
           if($result){
           echo "<h1>Welcome, $username</h1>";
                echo '<h1>Payment Successful</h1>';

             }else{
                  echo "Payment Error";
                   }


                 ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:34:17+00:00Added an answer on June 11, 2026 at 10:34 am

    Your data type of the column must be decimal and must have precision and scale. The precision represents the number of significant digits that are stored for values, and the scale represents the number of digits that can be stored following the decimal point.

    Example

    paypalAmount DECIMAL(10,2)
    

    by default the value of precision is 10 and the scale is 0. If the value of your scale is 0 then it will not have decimal value and causing to round the value you inserted.

    SQLFiddle Demo

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to update Paypal Order status and add tracking number using API. but
I'm making a call to PayPal's credit card processor, and after a successful/unsuccessful transaction
I know how to make a PayPal donate button redirect after payment, but what
After a successful Paypal transaction my customer lands on a Paypal Thank You page
I've implemented a paypal transaction before but this one has a twist that I'm
I'm trying to get Paypal to redirect to my website after a transaction and
I've been searching online to find ways of incorporating paypal into flash after discovering
We're using the PayPal _cart system, but need to be able to limit shipping
I'm implementing PayPal IPN & PDT. After some headache & time at the sandbox,
I'm trying to figure out how to use PayPal's IPN and I've run into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.