LOW COST JAVA PHP MYSQL CGI PERL
HOSTING SERVICE
LINUX WINDOWS CPANEL WHM PLESK
HOSTING PACKAGES
ECOMMERCE HOSTING ASP JSP MSSQL
FRONTPAGE HOSTING
CPANEL WHM RESELLER DEDICATED
SERVER WEB HOSTING

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);

Bookmark on del.icio.us digg this

This post is compiled by eUKhost.com

Leave a Comment

You must be logged in to post a comment.