garethashton
Programmer
I connect to a MySQL database with PHP. On one of my forms, I need to get a money ammount into my database so I can make calculations on it.
If I enter 2000 then it stores it in a number field as 2000.
But if I enter 2,000 then it stores it as 2.
Is there a field type in MySQL that can store a number (not a string) but also regcognise a comma (,) as a 1000's place divider and not a period (.) Is it also possible to enter a curreny symbol ($)?
--Or can PHP remove non-digit signs and still give the correct number to MySQL?
Any help is appreciated.
If I enter 2000 then it stores it in a number field as 2000.
But if I enter 2,000 then it stores it as 2.
Is there a field type in MySQL that can store a number (not a string) but also regcognise a comma (,) as a 1000's place divider and not a period (.) Is it also possible to enter a curreny symbol ($)?
--Or can PHP remove non-digit signs and still give the correct number to MySQL?
Any help is appreciated.