Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\Program Files\xampp\htdocs\ZA_Kamez\include.php on line 21
What does this error mean??
<?php
include 'blogpost.php';
$connection = mysql_connect('localhost', 'login_h', '1234') or die ("<p class='error'>Sorry, we were unable to connect to the database server.</p>");
$database = "articles";
mysql_select_db($database, $connection) or die ("<p class='error'>Sorry, we were unable to connect to the database.</p>");
function GetBlogPosts($inId=null, $inTagId =null)
{
$query = null;
if (!empty($inId))
{
$query = mysql_query("SELECT * FROM blog_posts WHERE id = " . $inId . " ORDER BY id DESC");
}
else
{
$query = mysql_query("SELECT * FROM blog_posts ORDER BY id DESC");
}
$postArray = array();
while ($row = mysql_fetch_assoc($query))
{
$myPost = new BlogPost($row["id"], $row['title'], $row['post'], $row['postfull'], $row["author_id"], $row['date_up']);
array_push($postArray, $myPost);
}
return $postArray;
}
?>