SQL syntax error in phpMyAdmin while create table ?

If you are getting errors when you try to create a table like:

CREATE TABLE `foo` (
`bar` VARCHAR NOT NULL
)

And get a MySQL error:

MySQL said:
You have an error in your SQL syntax near ‘NOT NULL)’ at line 1

Then this probably means that you have forgotten to specify a length for the Varchar type
in the “Length/Values” column,which is a required field.

So, this is wrong:

CREATE TABLE bla (bla VARCHAR NOT NULL);

And this is correct:

CREATE TABLE bla (bla VARCHAR (25) NOT NULL);

Related Posts:

  • No Related Posts


Online 24X7 Chat Support
 
 
Telephone
Toll Free
Online chat
 
Online 24X7 Email Support
 
Emails
 
 
 
Support
Support email
sales
Sales email
 
Billing
Billing email
 
   
Latest Tutorials & Articles (Updated Daily)
http://blog.eukhost.com
  Forums :
http://www.eukhost.com/forums/