Currency: php/mysql
Posted: Mon Jun 07, 2004 8:21 pm
Hello all,
I wasn't sure if I should post this to the DB forum or PHP, so I took a shot...
I need to record the price of an item in a database field.
The value could be anywhere from 10.95 to 120.95.
Then I need to show that value as plain HTML as well as a value in a text field. Do you have any suggestions as to
1/ the best field type in mysql?
2/ and if needed the best way to format the value from php to the browser?
Right now I'm trying DECIMAL(7,2) but if I put a test value of 1,200.00 into the field it comes out 12.00.
Your help is appreciated,
Thanks,
dstefani
I wasn't sure if I should post this to the DB forum or PHP, so I took a shot...
I need to record the price of an item in a database field.
The value could be anywhere from 10.95 to 120.95.
Then I need to show that value as plain HTML as well as a value in a text field. Do you have any suggestions as to
1/ the best field type in mysql?
2/ and if needed the best way to format the value from php to the browser?
Right now I'm trying DECIMAL(7,2) but if I put a test value of 1,200.00 into the field it comes out 12.00.
Your help is appreciated,
Thanks,
dstefani