Page 1 of 1

Query error(phpmyAdmin form) mySQL, *nix

Posted: Sun Apr 20, 2003 4:05 pm
by Sky
Ok, I want to create a new table. I've tried variations of this query, and get various (but similar) errors. This last one was straight from the table-creation form on the (I think) latest version of phpmyadmin.

Code: Select all

Error

SQL-query :  

CREATE TABLE `site_items` (

`id` TINYINT( 2 ) NOT NULL AUTO_INCREMENT,
`bullet` TINYINT( 2 ) NOT NULL ,
`type` VARCHAR( 7 ) NOT NULL ,
`title` VARCHAR( 40 ) NOT NULL ,
`date` VARCHAR( 20 ) NOT NULL ,
`url` VARCHAR( 50 ) NOT NULL ,
`content` LONGTEXT( 500 ) NOT NULL ,
INDEX ( `id` ) 
) 

MySQL said: 


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 '(500) NOT NULL, INDEX (`id`))' at line 1
Back

Posted: Sun Apr 20, 2003 9:02 pm
by volka
try

Code: Select all

CREATE TABLE `site_items` (
`id` TINYINT( 2 ) NOT NULL AUTO_INCREMENT,
`bullet` TINYINT( 2 ) NOT NULL ,
`type` VARCHAR( 7 ) NOT NULL ,
`title` VARCHAR( 40 ) NOT NULL ,
`date` VARCHAR( 20 ) NOT NULL ,
`url` VARCHAR( 50 ) NOT NULL ,
`content` LONGTEXT NOT NULL ,
INDEX ( `id` )
)
instead

Posted: Sun Apr 20, 2003 9:36 pm
by Sky
I finally got it working... and that was the solution :) thanks much, again, volka... :D