title: MySQL Error: "mysql_fetch_assoc() expects parameter 1 to be resource"
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://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:</p>
  
  <p><code>Warning: mysql_fetch_assoc() expects parameter 1 to be resource</code></p>
  
  <p>My query seems fine, here is my code:</p>
  
  <pre><code>function products()
  {
    $query = "SELECT id, quantity, price FROM dvd WHERE quantity &gt; 0";
      if (!$query) 
      {
        echo "no product found";
        die(mysql_error());
      }
      else
      {
        while ($query_row = mysql_fetch_assoc($query)){
          echo "Test";
      }
    }
  }
  </code></pre>
  
  <p>What does that error mean?</p>