Ok, I got this script off the internet, on a PHP tutorial site. The only problem is, it won't work! I've bashed my brains out modifying it, and adding stuff from the books I have, but it won't work at all.
Thanks for any help you can give. I tested the script on two different accounts too.
The code:
<?
$usr = "@@@@";
$pwd = "@@@@";
$db = "@@@@";
$host = "localhost";
# connect to database
$cid = mysql_connect($host,$usr,$pwd);
if (!$cid) { echo("ERROR: " . mysql_error() . "\n"); }
# setup SQL statement
# create links table
$SQL = " CREATE TABLE home (";
$SQL = $SQL . " id INT NOT NULL AUTO_INCREMENT, ";
$SQL = $SQL . " main TEXT, ";
$SQL = $SQL . " features TEXT, ";
$SQL = $SQL . " PRIMARY KEY(id) );";
$SQL = " CREATE TABLE administer (";
$SQL = $SQL . " main TEXT, ";
$SQL = $SQL . " doing TEXT, ";
$SQL = $SQL . " done TEXT, ";
$SQL = " CREATE TABLE flavor (";
$SQL = $SQL . " main TEXT, ";
$SQL = $SQL . " options TEXT, ";
$SQL = $SQL . " exoptions TEXT, ";
$SQL = " CREATE TABLE how (";
$SQL = $SQL . " main TEXT, ";
$SQL = $SQL . " you TEXT, ";
$SQL = $SQL . " it TEXT, ";
$SQL = " CREATE TABLE order (";
$SQL = $SQL . " main TEXT, ";
$SQL = $SQL . " quick TEXT, ";
$SQL = $SQL . " order TEXT, ";
# execute SQL statement
$result = mysql_db_query($db,"$SQL",$cid);
# check for error
if (!$result) { echo("ERROR: " . mysql_error() . "\n$SQL\n"); }
# display result for table creation query
# this should be 1 on a success
echo ("Links Results RESULT = $result\n\n");
mysql_close($cid);
?>
And this is the error I keep getting:
ERROR: You have an error in your SQL syntax near
'' at line 1 CREATE TABLE how ( main TEXT, you TEXT, it TEXT, Links Results RESULT =
Thanks in advance.