I have the following script to create tables in a mysql database
$dbhost = 'localhost';
$dbuser = 'root';
$con = "mysql_connect($dbhost, $dbuser, '')";
$create=mysql_query("CREATE TABLE `$table_name` (ID int NOT NULL AUTO_INCREMENT KEY,high TEXT ,low TEXT ,Divergence TEXT ,Change_Percent TEXT ,Low_Price TEXT ,High_Price TEXT ,Low_Proximity TEXT ,Vol_Index TEXT ,Vol TEXT ,Purchase_Value TEXT)");
if (mysql_query($con,$create))
{
echo "Table created successfully";
}
else
{
echo "Error creating table: " . mysql_error($conn);
}
Executing the script does create an the desired table, however it also gives the following error
Warning: mysql_query() expects parameter 2 to be resource, boolean given in C:\xampp\htdocs\test\test.php on line 136
Error creating table:
Now according to me this means $create returns "FALSE" which would be the case if the table was not created, however in this case the table has been created, what then is making it a Boolean? and How can I stop this error??