Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6169146/php-warning-sort-expects-parameter-1-to-be-array-resource-given">PHP: Warning: sort() expects parameter 1 to be array, resource given </a>  </p>
</blockquote>



<p>I have the following PHP code but get this error. I tried different solutions but it does not seem to work. Any help would be greatly appreciated. </p>

<pre><code>&lt;?php
INCLUDE 'functions.php' ;

$host = 'localhost';    
$id = '***';    
$pwd = '***';    
$db = '****'; 

$myconnection = connect_db($host, $id, $pwd, $db);

$SortOn = $_POST["SortOn"];    
$SortIn = $_POST["SortIn"];


$sql = "SELECT ID, DateTime, FirstName, LastName, AdditionalInformation, Category1,    Category2, Category3, Category4, Category5, Pending, Approved, Disapproved, WebsiteName, WebsiteURL FROM 'websites' ORDER BY $SortOn $SortIn";
echo "&lt;table border=\"1\"&gt;&lt;tr&gt;&lt;th&gt;ID&lt;/th&gt;&lt;th&gt;Date &amp; Time&lt;/th&gt;&lt;th&gt;First Name&lt;/th&gt;&lt;th&gt;Last Name&lt;/th&gt;&lt;th&gt;Additional Information&lt;/th&gt;&lt;th&gt;Category 1&lt;/th&gt;&lt;th&gt;Category 2&lt;/th&gt;&lt;th&gt;Category 3&lt;/th&gt;&lt;th&gt;Category 4&lt;/th&gt;&lt;th&gt;Category 5&lt;/th&gt;&lt;th&gt;Pending&lt;/th&gt;&lt;th&gt;Approved&lt;/th&gt;&lt;th&gt;Disapproved&lt;/th&gt;&lt;th&gt;Website Name&lt;/th&gt;&lt;th&gt;Website URL&lt;/th&gt;&lt;/tr&gt;";

$result = mysql_query($sql);            



while ( $row = mysql_fetch_array($result))            
{                
    echo "&lt;tr&gt;";        
    for ( $column = 0;$column &lt; count($row);$column++)        
    {            
        echo "&lt;td&gt;" . $row[$column] . "&lt;/td&gt;";        
    }        
    echo "&lt;/tr&gt;";    


}            
echo "&lt;/table&gt;";

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