I know that this has been asked hundreds of times before, but I looked around the Internet and couldn't find what could possibly be wrong with my syntax:
mysql_select_db('Projects');
$sql = "CREATE TABLE $data[ID] (
ID INT NOT NULL,
Creator INT NOT NULL,
Name VARCHAR(20) NOT NULL,
Version VARCHAR(20) NOT NULL,
Status VARCHAR(20) NOT NULL,
Date VARCHAR(20) NOT NULL,
Skript VARCHAR(20) NOT NULL,
Filename VARCHAR(20) NOT NULL,
Downloads INT NOT NULL,
PRIMARY KEY(ID)
)";
if (mysql_query($sql)){
echo "Created";
}else{
echo "Not created, ".mysql_error();
}
I tried using backticks, quotation marks et.c but in vain. The table name (21) displayed in the error is correct.
Here's the error that I get, including the echo "Not created, ";:
Not created, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '23 ( ID INT NOT NULL, Creator INT NOT NULL, Name VARCHAR(20) NOT NUL' at line 1