Hello,
In PHP and mysql I am creating a script that adds a new event on the command of the administartor. Everything in the script works fine apart from the create table script. No table is created. I added a 'die' to the end of the query to show the mysql error and to check the table name is correct and this is what I get:
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 '{ 'memberID' INT NOT NULL, PRIMARY KEY(memberID), 'Name' VARCHAR(65), 'em' at line 2 CASPA10.
CASPA10 is the table name and is the right one.
Here is the code causing the problem:
$id="CASPA$idl";
$create="CREATE TABLE $id
{
'memberID' INT NOT NULL,
PRIMARY KEY(memberID),
'Name' VARCHAR(65),
'email' VARCHAR(65)
}";
$q=mysql_query($create) or die(mysql_error() . $id);
Any ideas?
Regards
James