I have an sql statement to setup a few tables and it runs in
mySQLcontrol and even PHPMyAdmin, but it fails to run when starting it
in php. The error I get is
"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 '"
it then lists part of the begining of the statement.
I'm running XP IIS 5.1
MYSQL : 4.0.18-nt
PHP : 4.3.3.3
The statement is :
DROP TABLE IF EXISTS S4AS_Clips;
CREATE TABLE S4AS_Clips(
clip_ID Int( 11 ) unsigned NOT NULL AUTO_INCREMENT ,
clip_FileName Varchar( 16 ) default NULL ,
clip_Name Varchar( 30 ) default NULL ,
clip_Author Varchar( 30 ) default NULL ,
clip_Description Varchar( 100 ) default NULL ,
clip_Votes Int( 11 ) default 0,
PRIMARY KEY ( clip_ID )
) TYPE = MYISAM;
DROP TABLE IF EXISTS S4AS_Competitions
CREATE TABLE S4AS_Competitions(
comp_ID Int( 11 ) unsigned NOT NULL AUTO_INCREMENT ,
comp_Votable bool default 0,
comp_Winner Int( 11 ) default 0,
comp_Date TIMESTAMP( 16 ) ,
comp_Description Varchar( 100 ) default NULL ,
PRIMARY KEY ( comp_ID )
) TYPE = MYISAM ;
Any clues what it could be. The connection works fine with other SQL
statements. The connection code is bellow:
define("sys_dbhost", "localhost");
define("sys_dbuser", "mike");
define("sys_dbpasswd", "");
define("sys_dbname", "VideoUpload");
$db = mysql_connect(sys_dbhost, sys_dbuser, sys_dbpasswd);
mysql_select_db(sys_dbname, $db);
if (mysql_query($mySql, $db)) {
echo("Created!");
}
Thanks in advance,
Mike.