Jump to content

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/88968-db-sql-error-easy-fix/
Share on other sites

try

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

) 

Link to comment
https://forums.phpfreaks.com/topic/88968-db-sql-error-easy-fix/#findComment-455667
Share on other sites

Guest
This topic is now 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.