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? Quote Link to comment 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 Quote Link to comment 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.