Here's my problem.
I have a column called "networth" in my MySQL table, which is of the type varchar usnsigned, that has data such as "7,000,000".
What I want to do is a query like:
$networth = 5000000;
mysql_query("SELECT * FROM table WHERE networth > $networth");
That sort of thing should normally work, but because of the stupid commas it doesn't do what it's supposed to.
The user submits the value of $networth, so I don't want to force them to use commas.
If I strip the commas out of the database, which I can do easily, I'll have to insert them back into the string before displaying them to the browser.
So is there a way I can do this greater than/less than type of query without altering my database?
If not, what's the best way to format a string with commas, such as making "1234" into "1,234"?
Thanks in advance for any help.