Lamez Posted December 31, 2008 Share Posted December 31, 2008 I am trying to create a mysql query with two order bys, and I am lost. I want to order by the sticks first, then by the ids, and I am getting every forum topic sticky'ed, and locked. here is my code: <?php $sql = "SELECT * FROM mb ORDER BY id AND sticky DESC"; $result = mysql_query($sql); ?> Link to comment https://forums.phpfreaks.com/topic/138980-solved-two-order-bys/ Share on other sites More sharing options...
GingerRobot Posted December 31, 2008 Share Posted December 31, 2008 You need to use a comma to separate the things you wish to order by, not AND. Link to comment https://forums.phpfreaks.com/topic/138980-solved-two-order-bys/#findComment-726851 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.