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
https://forums.phpfreaks.com/topic/3087-mysql-coding-assistance/
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
https://forums.phpfreaks.com/topic/3087-mysql-coding-assistance/#findComment-10317
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
https://forums.phpfreaks.com/topic/3087-mysql-coding-assistance/#findComment-10337
Share on other sites

Archived

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

×
×
  • 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.