Why am I getting supplied argument is not a valid MySQL result resource error
<p>I am trying to display blogs on a certain page here is my code:</p>

<pre><code>&lt;?php
$query = "SELECT * FROM `Blogs` WHERE `Author` = '".$prof-&gt;id."' &amp;&amp; `id` != '" . mysql_real_escape_string($_GET['id']) . "' &amp;&amp; `status` = 'active' LIMIT 6" &amp;&amp; "ORDER BY `date` DESC, `time` DESC ";

$request = mysql_query($query,$connection);

while($result = mysql_fetch_array($request)) {
 echo "&lt;div class='OldBlogs round_10px'&gt;";
 echo "&lt;div class='blogIcon'&gt;";
 echo "&lt;a href='http://www.blah.org/BlogProfile.php?id=".$result['id']."'&gt;";
 echo "&lt;img src='http://www.blah.org/styles/images/blogIcon.png' border='0'/&gt;";
 echo "&lt;/a&gt;";
 echo "&lt;/div&gt;";
 echo "&lt;div class='recentBlogTitles'&gt;";
 echo "&lt;a href='http://www.blah.org/BlogProfile.php?id=".$result['id']."'&gt;";
 echo stripslashes($result['blogTitle']);
 echo "&lt;/a&gt;";
 echo "&lt;br /&gt;";
 echo "&lt;span class='recentBlogdate'&gt;";
 echo "on " . date("M d, Y",strtotime($result['date']));
 echo "&lt;/span&gt;";
 echo "&lt;/div&gt;";
 echo "&lt;/div&gt;";
}

?&gt;
</code></pre>

<p>and I am getting this error:</p>

<p>note: line 118 is <code>while($result = mysql_fetch_array($request)) {</code></p>

<p>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/l/l/0/blah/html/BlogProfile.php on line 118</p>
