Code: Select all
<?php
include("setup.php");
include("database.php");
ob_start();
$table = "table_name";
$pagetest = mysql_query("select count(*) as count from '$table'");
$pages = mysql_fetch_object($pagetest)->count;
$pagenum = intval($pages);
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource on line 6
How could I use a variable as a table name?