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

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.