mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in error in php
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2973202/php-error-mysql-fetch-array-expects-parameter-1-to-be-resource-boolean-given">PHP Error: mysql_fetch_array() expects parameter 1 to be resource, boolean given</a>  </p>
</blockquote>



<p>I am getting the following error for the code mentioned below in php:</p>

<blockquote>
  <p><br />
  <b>Warning</b>:  mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in <b>/Users/pubs/Sites3/parse/includes/parseAuthorSearch.php</b> on line <b>62</b><br />
  <br />
  <b>Warning</b>:  mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in <b>/Users/pubs/Sites3/parse/includes/parseAuthorSearch.php</b> on line <b>62</b><br /></p>
</blockquote>

<pre><code>function findExactAuthorMatch($firstname, $lastname)
{
    $query22 = "SELECT COUNT(*) FROM authors WHERE lastname='".$lastname."' AND firstname='".$firstname."'";    
    $result22 = mysql_query($query22);
    $count22 = mysql_fetch_assoc($result22);
    if($count22 == 0) return false;
    else return true;
}
</code></pre>
