Re: Natural order of things.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tedd wrote:
SELECT id, title, url_image_small
FROM $dbtable
WHERE type="type_title"
ORDER BY title
LIMIT $offset, $rowsPerPage"

But, it sorts stuff like this:

Basel Square 1
Basel Square 10
Basel Square 11
Basel Square 2
Basel Square 3
Basel Square 4
Basel Square 5
Basel Square 6
Basel Square 7
Basel Square 8
Basel Square 9

What do I have to change to get it (the query) to sort like this:

Basel Square 1
Basel Square 2
Basel Square 3
Basel Square 4
Basel Square 5
Basel Square 6
Basel Square 7
Basel Square 8
Basel Square 9
Basel Square 10
Basel Square 11

Never tried it mysql, but I am led to believe that sorting based on the result of the mysql SOUNDEX function may produce the results you want. Other than that, as far as I am aware there is no way to do this in MySQL without writing a stored procedure to do it.

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux