PHPMyAdmin - #1064 - You have an error in your SQL syntax

Associate
Joined
17 Jan 2006
Posts
3
Hey guys,

im new to php and mysql etc. but on setting up a database on my host using phpmyadmin i keep getting the following error: -

#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 '(300), PRIMARY KEY (`ID`))' at line 1

Here is the database code: -

CREATE TABLE `projects` (

`ID` INT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`Title` VARCHAR( 20 ) ,
`Article` BLOB( 300 ) ,
PRIMARY KEY ( `ID` )
)

The host runs MYSQL 4.0.15, any suggestions/help anyone please?
 
Associate
Joined
16 May 2005
Posts
680
I did this with phpMyAdmin

Code:
CREATE TABLE `projects` (
`ID` INT( 3 ) NOT NULL AUTO_INCREMENT ,
`Title` VARCHAR( 20 ) NOT NULL ,
`Article` BLOB NOT NULL ,
PRIMARY KEY ( `ID` ) 
) TYPE = MYISAM ;
 
Associate
Joined
16 May 2005
Posts
680
It's just your table type, I think MYISAM is generally the default.

Looking at the code I think the problem is setting a length on the BLOB, which I don't think you can do.

If you haven't got an interface online for the DB, I'd recommend something like http://www.webyog.com/sqlyog/download_sqlyogfree.html This will show you the syntax it uses to generate the tables, but you can just click options and choose from drop down lists.
 
Back
Top Bottom