I'm pretty new to SQL and PHP and have a question:
I want to store currency amounts but can't see an easy way to do this and maintain formating like $10,000 I know there is a function in MySQL to do this but what format should I use for the field and how do I get PHP to show it formated?
Sorry if this is ultra basic.
Bret
Hello Bert,
I am searching for the same. If you get any solution pls mail me. raju@ritwik.com
Regards Raju.
Use the MySQL function called format(num, decimal) like this:
select format(amount, 2) from invoice;
where amount is a column name containing a number equal to 32458.76
Your result, when printed, will look like:
32,458.76
Tada!