solarisuser Posted June 1, 2007 Share Posted June 1, 2007 Hi All, I have records named "Entry-1", "Entry-2", .... "Entry-10", "Entry-11", etc... When I list them using: while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { echo "$row[entry]"; } I get .. Entry-1 Entry-10 Entry-11 Entry-12 Entry-13 Entry-14 Entry-2 Entry-3 Entry-4 Entry-5 .. Entry-9 Is there a way to deal with my situation so that Entry-10 and on come after Entry-9? I would not mind modifying my MySQL statement if thats what it takes. BTW - I can't change Entry-1 to Entry-01 in the DB. Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/53809-sorting-names-by-a-special-way/ Share on other sites More sharing options...
Caesar Posted June 1, 2007 Share Posted June 1, 2007 If you can't order it in your SQL query (Eg. "SELECT * FROM table ORDER BY column")...then try: http://www.php.net/usort Quote Link to comment https://forums.phpfreaks.com/topic/53809-sorting-names-by-a-special-way/#findComment-265950 Share on other sites More sharing options...
solarisuser Posted June 1, 2007 Author Share Posted June 1, 2007 Damn, usort() looks complicate.... anyone out there willing to give me something to work with.. the examples don't seem to apply to me. Quote Link to comment https://forums.phpfreaks.com/topic/53809-sorting-names-by-a-special-way/#findComment-265973 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.