Jump to content

sql problem


nickbunyun

Recommended Posts

Error

SQL query:

 

CREATE TABLE `inventory` (

 

`id` int NOT NULL PRIMARY KEY '',

`full_name` varchar( 100 ) NOT NULL default '',

`phone_number` varchar( 20 ) NOT NULL default '',

`address` text NOT NULL default '',

`short_info` varchar( 150 ) NOT NULL default '',

`long_info` text NOT NULL default '',

`new_date` date '',

`user` varchar( 20 ) NOT NULL default '',

`other_info` text NOT NULL default '',

 

)

 

MySQL said: 

 

#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 ''',

`full_name` varchar(100) NOT NULL default '',

`phone_number` varchar(20) N' at line 2

 

 

Link to comment
https://forums.phpfreaks.com/topic/88967-sql-problem/
Share on other sites

CREATE TABLE `inventory` (

`id` int NOT NULL PRIMARY KEY,
`full_name` varchar( 100 ) NOT NULL default '',
`phone_number` varchar( 20 ) NOT NULL default '',
`address` text NOT NULL default '',
`short_info` varchar( 150 ) NOT NULL default '',
`long_info` text NOT NULL default '',
`new_date` date,
`user` varchar( 20 ) NOT NULL default '',
`other_info` text NOT NULL default ''

) 

 

That works

Link to comment
https://forums.phpfreaks.com/topic/88967-sql-problem/#findComment-455733
Share on other sites

Error

SQL query:

 

CREATE TABLE `inventory` (

 

`id` int NOT NULL PRIMARY KEY '',

`full_name` varchar( 100 ) NOT NULL default '',

`phone_number` varchar( 20 ) NOT NULL default '',

`address` text NOT NULL default '',

`short_info` varchar( 150 ) NOT NULL default '',

`long_info` text NOT NULL default '',

`new_date` date '',

`user` varchar( 20 ) NOT NULL default '',

`other_info` text NOT NULL default '', <-- your problem I believe

 

)

 

I don't know if you got this working or not but I marked what I believe is your problem. there is an extra comma so SQL is looking for another command.

 

I would like to know if this fixes the problem for sure

Link to comment
https://forums.phpfreaks.com/topic/88967-sql-problem/#findComment-460879
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.