Hey. I'm trying to make a table, but its not working. Here's my script.
<?php
require ("univvars.php");
mysql_connect($Host, $User, $Pass) or die(mysql_error());
print ("<p>Connected to MySQL...");
$Query = "CREATE table market (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, Type TEXT, Name TEXT, Cost TEXT, Employing TEXT, Income TEXT, Left TEXT)";
mysql_select_db($DBName) or die(mysql_error());
print ("<p>Connected to Database...");
if (mysql_query($Query))
{
print ("<p>Table was completed!");
}
else
{
print ("<p>Table was not completed.");
}
?>
I am thinking that my query is wrong somehow.
All that is included in univvars.php is my connection variables ($Host, $User, $Pass, $Link).
Every time I run this script, it gives me the "Table was not completed." thing.
It's not that the database is already there, because if it was, this would work:
<?php
require ("univvars.php");
mysql_connect($Host, $User, $Pass) or die("Unable to connect to database!");
$Query = "INSERT into table market values ('Farm', 'Wheat', '100c', '10', '10c yearly', '9999')";
if (mysql_db_query ($DBName, $Query, $Link))
{
print ("info ENTERED!");
}
else
{
print ("info NOT ENTERED!");
}
mysql_close ($Link)
?>
This is holding me up.....can anyone help me with it?