Re: Incorrect ordering in PHP/MySQL statement
| From: | Ben Weinberger | Date: | Fri, 22 Dec 2000 19:09:40 +0000 |
| Subject: | Re: Incorrect ordering in PHP/MySQL statement | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31613@lists.php.net to get a copy of this message | ||
Worked great-- thank you!
-Ben
At 02:03 PM 12/22/2000 -0500, Ignacio Vazquez-Abrams wrote:
On Fri, 22 Dec 2000, Ben Weinberger wrote: Hi~ I have the following query in a PHP document: SELECT * FROM products WHERE subcat='test' ORDER BY sort; This displays all products in the subcategory test and lists them in order according to the sort column. However, the order is displayed as follows: 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, etc. It should go: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, etc. How can I get it to display the products in the correct order? Thanks, -Ben Store sort as a numeric (INT etc.) type, not as a string type (CHAR etc.). -- Ignacio Vazquez-Abrams <ignacio@openservices.net> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net