PDA

View Full Version : sql syntax error


sir pannels
02-03-2006, 04:36 PM
Hi,

Have a syntax error in the query below, I have been staring at this for agees and can't get it. Hoping a fresh pair of eyes may help...

CREATE TABLE $var4.Comms (
ID int(11) NOT NULL auto_increment,
IP varchar(20) default NULL,
Port int(11) default '0',
Type int(11) default '0',
EquipDesc varchar(25) default NULL,
LastCollected datetime default '0000-00-00 00:00:00',
Comment varchar(255) default NULL,
ErrorCode int(11) default '0',
PRIMARY KEY (ID)


The error is simply ..

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 '' at line 10

... which is not over imformative.

Many thanks,
P

vinyl-junkie
02-07-2006, 02:19 PM
Is your create table statement in a PHP program? What is the value of $var4? Also, what are the statements in your code immediately preceding this?

Kid Charming
02-07-2006, 05:58 PM
You're missing a closing parenthesis:

PRIMARY KEY (ID) )