I have a script that checks if a table exists and if it does not then it creates one. The table gets create fine and the data goes in correctly. Once a table has been created and encounters the script I use the test again. However it always returns true and runs the create table script.Can anyone explain why.
<?php
include 'config.php';
$scriptot = ($_POST["ohyeah"]);
$scriptname = ($_POST["scriptname"]);
$y = 1;
$scriptnamed = "".$scriptname."equip";
$r= 1;
$scriptot = $scriptot + 1;
echo $scriptnamed;
$val = mysql_query("select 1 from specifics");
echo $val;
if($val !== FALSE)
{
echo 'its there';
}
else
{
echo 'No table Found';//always runs this even if exists
// sql to create table
$sql1 = "CREATE TABLE specifics (
ID int NOT NULL AUTO_INCREMENT,
equiplist varchar(255),
stage varchar(255),
PRIMARY KEY (ID)
)";
}