Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in
<pre><code>&lt;html&gt;
&lt;title&gt;Title&lt;/title&gt;
&lt;body&gt;
    &lt;link type="text/css" rel="stylesheet" href="css/bootstrap.css"/&gt;

&lt;/body&gt;



&lt;center&gt;
&lt;?
mysql_connect ("localhost", "root","")  or die (mysql_error());
mysql_select_db ("dbname");

$term = $_POST['term'];

$sql = mysql_query("select * from items where name like '%$term%'");

while ($row = mysql_fetch_array($sql)){
    echo '&lt;table class="table - striped"&gt; &lt;theader&gt; &lt;tr&gt; &lt;th&gt;ID&lt;/th&gt; &lt;th&gt;&lt;/br&gt; Name&lt;/th&gt;&lt;/tr&gt;'; echo ' &lt;tbody&gt;&lt;td&gt;'.$row['id']; echo'&lt;/td&gt;';
    echo '&lt;td&gt;'; echo '&lt;/theader&gt;' .$row['name']; echo '&lt;/td&gt;';


    echo '';
    }


?&gt;
&lt;/center&gt;
&lt;script src="js/bootsrap.js"&gt; &lt;/script&gt;
&lt;/html&gt;
</code></pre>

<p>I'm, getting this error: </p>

<pre><code>Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/runedev1/public_html/itemdb/search.php on line 19
</code></pre>

<p>When I run the code on localhost using Xampp, it works fine, when I upload it to the web-host, the error appears.</p>

<p>Yes, I am changing the database name, user and password when putting it on the webhost.</p>
