Php error on if statement
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5473981/warning-mysql-fetch-array-expects-parameter-1-to-be-resource-boolean-given-i">Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in</a>  </p>
</blockquote>



<p>ERROR -> Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in</p>

<pre><code>    $sql = "SELECT * FROM pictures WHERE filename=$filename";
//makes a query to the database using the question in variable sql.
$result = mysql_query($sql);

ERROR -&gt;if(!($row = mysql_fetch_array($result)))
    {
     //code.......
</code></pre>

<p>I don't get it, what am I doing wrong, there is nothing wrong about the parameter...</p>
