hypnotic_monkey Posted March 16, 2008 Share Posted March 16, 2008 $query="SELECT artist_id, genre, title, description, url, realName, memberName FROM mixes LEFT JOIN members ON (ID_MEMBER = artist_id)"; $result=mysql_query($query); $num = mysql_num_rows ($result); while($row = mysql_fetch_array($result)) { echo''; } WORKS FINE!!!! but when i change it to: $query="SELECT artist_id, genre, title, description, url, realName, memberName FROM mixes ORDER BY mix_id DESC LEFT JOIN members ON (ID_MEMBER = artist_id)"; $result=mysql_query($query); $num = mysql_num_rows ($result); while($row = mysql_fetch_array($result)) { echo ''; } I get this: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in... its just that ORDER BY bit..... what have i done wrong? Link to comment https://forums.phpfreaks.com/topic/96352-order-by-not-working/ Share on other sites More sharing options...
JD* Posted March 16, 2008 Share Posted March 16, 2008 I think ORDER BY has to be the last thing in the query, even with a join Link to comment https://forums.phpfreaks.com/topic/96352-order-by-not-working/#findComment-493191 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.