Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Needed Help with SQL Syntax 1

Status
Not open for further replies.

Ederico

Computer
Jan 24, 2005
6
Hello all, this is my first post.

I am currently trying to upload a database for a site I am working on however I constantly get the same error. My coding knowledge is close to nothing in relation to SQL.

I will provide the code that gives the error and the error in question:

"SQL-query:

CREATE TABLE mos_components(
id int( 11 ) NOT NULL AUTO_INCREMENT ,
name varchar( 50 ) NOT NULL default '',
link varchar( 255 ) NOT NULL default '',
menuid int( 11 ) unsigned NOT NULL default '0',
parent int( 11 ) unsigned NOT NULL default '0',
admin_menu_link varchar( 255 ) NOT NULL default '',
admin_menu_alt varchar( 255 ) NOT NULL default '',
OPTION varchar( 50 ) NOT NULL default '',
ordering int( 11 ) NOT NULL default '0',
admin_menu_img varchar( 255 ) NOT NULL default '',
iscore tinyint( 4 ) NOT NULL default '0',
params text NOT NULL ,
PRIMARY KEY ( id )
) TYPE = MYISAM

MySQL said: Documentation
#1064 - 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 'option varchar(50) NOT NULL default '',
ordering int(11) NOT"



If anyone can help, I'd greatly appreciate.

Regards,
Ederico.
 
Replies continue below

Recommended for you

'Option' is a reserved word and cannot be used as a column name.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Any idea of what it should be then? That database was functioning perfectly on my old server, but it does not upload on the new one.
 
What happens if I change that? Would I have to modify other code?
 
Can anyone answer my questions? My coding knowledge is practically inexistant.
 
Simply change 'option' to something else.

CREATE TABLE mos_components(
id int( 11 ) NOT NULL AUTO_INCREMENT ,
name varchar( 50 ) NOT NULL default '',
link varchar( 255 ) NOT NULL default '',
menuid int( 11 ) unsigned NOT NULL default '0',
parent int( 11 ) unsigned NOT NULL default '0',
admin_menu_link varchar( 255 ) NOT NULL default '',
admin_menu_alt varchar( 255 ) NOT NULL default '',
Opt_Code varchar( 50 ) NOT NULL default '',
ordering int( 11 ) NOT NULL default '0',
admin_menu_img varchar( 255 ) NOT NULL default '',
iscore tinyint( 4 ) NOT NULL default '0',
params text NOT NULL ,
PRIMARY KEY ( id )
) TYPE = MYISAM

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
I get the following error now, I hope you can help:

SQL-query:

--
-- Table structure for table `mos_content`
--
CREATE TABLE mos_content(
id int( 11 ) unsigned NOT NULL AUTO_INCREMENT ,
title varchar( 100 ) NOT NULL default '',
title_alias varchar( 100 ) NOT NULL default '',
introtext mediumtext NOT NULL ,
FULLTEXT mediumtext NOT NULL ,
state tinyint( 3 ) NOT NULL default '0',
sectionid int( 11 ) unsigned NOT NULL default '0',
mask int( 11 ) unsigned NOT NULL default '0',
catid int( 11 ) unsigned NOT NULL default '0',
created datetime NOT NULL default '0000-00-00 00:00:00',
created_by int( 11 ) unsigned NOT NULL default '0',
created_by_alias varchar( 100 ) NOT NULL default '',
modified datetime NOT NULL default '0000-00-00 00:00:00',
modified_by int( 11 ) unsigned NOT NULL default '0',
checked_out int( 11 ) unsigned NOT NULL default '0',
checked_out_time datetime NOT NULL default '0000-00-00 00:00:00',
publish_up datetime NOT NULL default '0000-00-00 00:00:00',
publish_down datetime NOT NULL default '0000-00-00 00:00:00',
images text NOT NULL ,
urls text NOT NULL ,
attribs text NOT NULL ,
version int( 11 ) unsigned NOT NULL default '1',
parentid int( 11 ) unsigned NOT NULL default '0',
ordering int( 11 ) NOT NULL default '0',
metakey text NOT NULL ,
metadesc text NOT NULL ,
access int( 11 ) unsigned NOT NULL default '0',
hits int( 11 ) unsigned NOT NULL default '0',
PRIMARY KEY ( id ) ,
KEY idx_section( sectionid ) ,
KEY idx_access( access ) ,
KEY idx_checkout( checked_out ) ,
KEY idx_state( state ) ,
KEY idx_catid( catid ) ,
KEY idx_mask( mask )
) TYPE = MYISAM

MySQL said: Documentation
#1064 - 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 'mediumtext NOT NULL,
state tinyint(3) NOT NULL default '0',


I hope you can help to make this database function, I wonder what is wrong, the db works perfectly on the old server, no problems there.

Regards,
Edric.
 
Ederico said:
the db works perfectly on the old server,
What database manager is running on the old server? Is is SQL Server, Oracle, MS Access, MySQL, or another product. I suspect that it is not MySQL and you are running into differences between two different database management products. Different products have different idiosyncrasies and if you converting from one to another, you need to brush up on those differences.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
It's the same error as before... you have a label in front of the line it's claiming the error is on. Check this label. Are you reading any of the documentation for MySQL?


Dan
Owner
 
@CajunCenturion,

I will check what version I had on the old server, unfortunately to answer I rely on other person as the old server is not in my control.

@macgyvers2000

I presume the error is FULLTEXT, I'll attempt changing that, I still have the original backup, and I can get the backup directly from the old server if I desire.

Thanks for your help, guys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor