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:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /***************************.php on line 67
<?
$query = "SELECT COUNT(*) as num FROM $tableName";
//////Below error line
$total_pages = mysql_fetch_array(mysql_query($query));
/////////////
$total_pages = $total_pages['num'];
?>