SQL syntax Error on Database Upload

Codes here !

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 3
Joined: Thu Oct 24, 2002 5:30 pm

SQL syntax Error on Database Upload

Postby griff » Fri Feb 14, 2003 3:25 pm

First of all I'm not a database guy...I'm a web designer..the db admin is out of pocket and the server died...now I'm left to reload the db. Maybe someone can help me.

After the server came back up, mysql running I tried using the dump utility from the myphpadmin area to reload the database from an uzipped backup file.

I'm receiving the following error...also including the code I think is generating the error... I don't have a clue what it is referring to

mySQL said:
You have an error in your SQL syntax near 'references varchar(127) NOT NULL default '',
PRIMARY KEY (company_id),
KEY' at line 16

CREATE TABLE companies (
company_id int(10) unsigned NOT NULL auto_increment,
category_id int(10) unsigned NOT NULL default '0',
name varchar(39) NOT NULL default '',
slogan varchar(255) NOT NULL default '',
address varchar(63) NOT NULL default '',
phone varchar(31) NOT NULL default '',
fax varchar(31) NOT NULL default '',
email varchar(127) NOT NULL default '',
web varchar(127) NOT NULL default '',
about varchar(127) NOT NULL default '',
directions varchar(127) NOT NULL default '',
logo char(0) NOT NULL default '',
priority enum('#1','#2','#3','#4') NOT NULL default '#3',
coupons varchar(127) NOT NULL default '',
references varchar(127) NOT NULL default '',
PRIMARY KEY (company_id),
KEY category_id(category_id),
KEY name(name),
KEY priority(priority)

Thanks RSG

User avatar
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby Redcircle » Sat Feb 15, 2003 9:20 am

You cannot have an enum value as a key and references is a value you cannot use as a field name. So if you changed references to just refer and removed priority as a key it would work.

Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 1 guest