SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    May 2002
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question I can't get price variable into MySQL. What am I doing wrong?

    I'm trying to enter a price variable into a MySQL database.

    I let users enter a price in a form's text field and it is inserted into the database.

    For example, I'd type "45,000,000.00" into the form, but all that turns up in the database record is "45". Same goes if I use spaces instead of commas.

    When I output the variable on the insert page to see if it is getting passed correctly it shows 45,000,000.00 or 45 000 000.00 or whatever I typed in but the database still only shows 45.

    I've tried Float, Double, and Decimal. I'd usually just use text but I have to sort on Price.

    What am I doing wrong and how do I fix this?

    Thanks.

    PS: it is MySQL version 3.23.56

  2. #2
    SitePoint Addict
    Join Date
    May 2002
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Never Mind ... got it to work.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •