Jump to content

mySQL coding assistance.


herbal_lavender

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

Link to comment
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

Link to comment
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.