Is there any way to pass a variable which represents a tablename to mysql_query? My code to do that is as follows:
<?
$result = mysql_query("SELECT * FROM $show",$connection);
if($myrow = mysql_fetch_array($result)){
do {
print $myrow['hyperlink'];
}while($myrow = mysql_fetch_array($result));
}else{
print"No entries in table";
}
?>
$show gets the table name from HTTP_GET VARS. I know the correct value is stored in $show, but whenever I run the code like this I get Not a Valid Resource error. If I hardcode the table name into the query, it works fine. Any help would be appreciated. Thanks
Todd