Jump to content

Archived

This topic is now archived and is closed to further replies.

herbal_lavender

mySQL coding assistance.

Recommended Posts

I am in need of assistance with this code. I'm attempting to make a table for a community. It seems everything is ok when I upload the .sql file except for this line.

 

create table bugs(bugid bigint primary key auto_increment, memberid bigint references members, bugtext text, type integer, bugdate DATE)

 

And this is what shows when I try to upload the file.

 

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 'create table bugs(bugid bigint primary key auto_increment, memb

 

 

Could someone help me.

 

Thanks.

Herbal_Lavender

Share this post


Link to post
Share on other sites

I ran your command on my server and got no error, so I dumped the table from my server and came up with this query:

 

CREATE TABLE `bugs` (

`bugid` bigint(20) NOT NULL auto_increment,

`memberid` bigint(20) default NULL,

`bugtext` text,

`type` int(11) default NULL,

`bugdate` date default NULL,

PRIMARY KEY (`bugid`)

) TYPE=MyISAM

 

Give that a shot, and let us know how it works

 

Chris

Share this post


Link to post
Share on other sites

It's possible that you're trying to run that code on a server that doesn't have complete foreign key reference support for InnoDB table, so the parser is throwing the error. Using the CREATE TABLE syntax posted above -- as a MyISAM table -- should resolve your problem.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.