Warning: mysql_fetch_array():
<p>Is it possible  to rewrite this script part it in different way? Because it works  fine in my localhost ,but  when i moved it in hosting it shows:</p>

<blockquote>
<pre><code>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /***************************.php on line 67
</code></pre>
</blockquote>

<pre><code>&lt;? 
$query = "SELECT COUNT(*) as num FROM $tableName"; 
//////Below error line
$total_pages = mysql_fetch_array(mysql_query($query)); 
/////////////
$total_pages = $total_pages['num'];
?&gt;
</code></pre>
