fearmyride Posted January 4, 2007 Share Posted January 4, 2007 [code]mysql_free_result($result); $query = "SELECT * FROM video_comments WHERE vid_id = $vid ORDER BY date DESC"; $result = mysql_query($query); while ($row = mysql_fetch_array($result, MYSQL_NUM)) { echo "<span class=\"embed\">{$row[2]}<span class=\"embed-caption\">{$row[4]}</span>{$row[3]}<br /> <br />"; }[/code]gives me this warning: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ....../video.php on line 80What i'm trying to do is get the comments for each item and display them ordered by date, if there is another way please let me know,thanks so much Quote Link to comment https://forums.phpfreaks.com/topic/32884-help-with-mysql-query/ Share on other sites More sharing options...
ober Posted January 4, 2007 Share Posted January 4, 2007 That means there is something wrong with the query.try this:$result = mysql_query($query) or die ("error: " . mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/32884-help-with-mysql-query/#findComment-153082 Share on other sites More sharing options...
fearmyride Posted January 4, 2007 Author Share Posted January 4, 2007 I did that and i got this error: error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY date DESC' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/32884-help-with-mysql-query/#findComment-153084 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.