<?php
function check_table()
{
$table = $this->stat_table;
$result = mysql_query("EXISTS TABLE $table");
echo $result;//nooutput at all here :/
if($result != 1)
{
echo $this->mysql->error("[red]$table was not found in the database[/font]<b>Would like to make it now?</b><br /><a href="$_SERVER[PHP_SELF]?maketable=1" style="color:blue">Yes!</a>");
}?>
<?php
function check_table()
{
$table = $this->stat_table;
$db = $this->mysql->DB_NAME;
$result = mysql_list_tables($db);
while($row = mysql_fetch_array($result))
{
$tables[] = $row[0];
}
if(!in_array($table, $tables) and !isset($_GET['maketable']))
{
echo $this->mysql->error("[red]$table was not found in the database[/font]<b>Would like to make it now?</b><br /><a href="$_SERVER[PHP_SELF]?$_SERVER[QUERY_STRING]&maketable=1" style="color:blue">Yes!</a>");
}
if(isset($_GET['maketable']) AND !in_array($table, $tables))
{
$query = mysql_query("CREATE TABLE `$table` (
`ID` int(11) NOT NULL auto_increment,
`browser` text NOT NULL,
`ip` varchar(20) NOT NULL default '0',
`redirect` text NOT NULL,
`time_stamp` int(20) NOT NULL default '0',
PRIMARY KEY (`ID`)
) TYPE=MyISAM")or die(mysql_error());
}
}
?>