Re: mysql money field type?

From: Date: Mon, 28 Jun 2004 16:08:55 +0000
Subject: Re: mysql money field type?
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-24075@lists.php.net to get a copy of this message
I have created a database for a local real estate company, and I am having issues trying to display home prices with commas. when you get into the hundreds of thousands of dollars, it is quite difficult to look at home prices without commas. I am using mySQL and PhpMyAdmin. Is there a mySQL field type that works for this, but also will sort properly? I tried using VARCHAR, and the display was right, but when I sorted the results by price, 1,200,000 appreared before 230,900.
Store the value as a number (integer) but then use a MySQL or PHP function (like PHP's number_format()) to format it with commas. Larry

« previous php.windows (#24075) next »