yjim Posted August 11, 2009 Share Posted August 11, 2009 im trying to order my mysql table by a varchar column that contains integers and php spits it out like this: 1,10,11,12,13,14,2,20,21,21 .. instead of 1,2,3,4,5,6,7,8,9,10,11 etc.. any idea how to fix this? here is my code: $query = mysql_query("SELECT * FROM items ORDER by uid asc"); while ($data = mysql_fetch_assoc($query)) { Link to comment https://forums.phpfreaks.com/topic/169834-solved-mysql-id-column-isnt-ordered-correctly/ Share on other sites More sharing options...
yjim Posted August 11, 2009 Author Share Posted August 11, 2009 nvmd this works: mysql_query("SELECT * FROM items ORDER by (uid+0) asc"); Link to comment https://forums.phpfreaks.com/topic/169834-solved-mysql-id-column-isnt-ordered-correctly/#findComment-895995 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.