Jump to content

mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in ....


TottoBennington

Recommended Posts

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){
           
                         echo $row ['article_title'] , '<br />';
          }


}



?>

 

MOD EDIT:

 . . . 

tags added, circus fonts removed.

 

 

$query = mysql_query("SELECT ´article_id´ , ´article_title´ , ´article_likes´ FROM ´articles' ");  // nope, error on this line ' should be  ´ like below
$query = mysql_query("SELECT ´article_id´ , ´article_title´ , ´article_likes´ FROM ´articles´");

function get_articles() {
             $articles = array ();
          
          $query = mysql_query("SELECT ´article_id´ , ´article_title´ , ´article_likes´ FROM ´articles´ ")or return false;
          
                          while (($row = mysql_fetch_assoc($query)) !=false){
           
                         echo $row ['article_title'] , '<br />';
          }


}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.