Zepo. Posted March 2, 2008 Share Posted March 2, 2008 I have a loop thats ordered by the field proiority. It works fine untill the priority gets above 9. http://www.eliteladders.com/development/ladders.php As you can see it put it after 1. $groups=mysql_query("SELECT id,name,logo,active,priority,created FROM groups WHERE active='1' ORDER BY priority"); while(list($gid,$gname,$glogo,$gactive,$gpriority,$gcreated)=mysql_fetch_row($groups)){ Link to comment https://forums.phpfreaks.com/topic/93946-mysql-order-by-issue/ Share on other sites More sharing options...
trq Posted March 2, 2008 Share Posted March 2, 2008 What field type is priority? Link to comment https://forums.phpfreaks.com/topic/93946-mysql-order-by-issue/#findComment-481351 Share on other sites More sharing options...
Zepo. Posted March 2, 2008 Author Share Posted March 2, 2008 varchar Limit 4 Link to comment https://forums.phpfreaks.com/topic/93946-mysql-order-by-issue/#findComment-481353 Share on other sites More sharing options...
trq Posted March 2, 2008 Share Posted March 2, 2008 There your problem. A varchar field will be ordered alphabetically. it will need to be an INT type. Link to comment https://forums.phpfreaks.com/topic/93946-mysql-order-by-issue/#findComment-481355 Share on other sites More sharing options...
Zepo. Posted March 2, 2008 Author Share Posted March 2, 2008 Thank you very much sir. Link to comment https://forums.phpfreaks.com/topic/93946-mysql-order-by-issue/#findComment-481356 Share on other sites More sharing options...
sasa Posted March 2, 2008 Share Posted March 2, 2008 try ORDER BY priority+0 Link to comment https://forums.phpfreaks.com/topic/93946-mysql-order-by-issue/#findComment-481425 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.