TottoBennington Posted January 21, 2012 Share Posted January 21, 2012 This is the error message : Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\wamp\www\LikeButton\articles.php on line 6 Can anyone help me ? <?php function get_articles() { $articles = array (); $query = mysql_query("SELECT ´article_id´ , ´article_title´ , ´article_likes´ FROM ´articles´ ") ; while (($row = mysql_fetch_assoc($query)) !=false){[size=12pt][u][b] Error is in this line[/b][/u][/size] echo $row ['article_title'] , '<br />'; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/255452-mysql-error-message-help-me-please/ Share on other sites More sharing options...
awjudd Posted January 21, 2012 Share Posted January 21, 2012 It means your query failed. Try adding or die(mysql_error()) to your query line ... $query = mysql_query("SELECT ´article_id´ , ´article_title´ , ´article_likes´ FROM ´articles´ ") OR die(mysql_error()) ; Quote Link to comment https://forums.phpfreaks.com/topic/255452-mysql-error-message-help-me-please/#findComment-1309712 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.