clown[NOR] Posted April 11, 2007 Share Posted April 11, 2007 well... as it said in the topic... there's an error somewhere in y CREATE TABLE... but I've been looking trough those same 9-10 lines now for about 45 minutes and I cant figure it out... I'll start off with the error message: 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 'release VARCHAR(30) NOT NULL, keywords VARCHAR(100) NOT NULL, rating INT' at line 6 Now over to the code: $query = " CREATE TABLE movies ( id INT(6) NOT NULL auto_increment, title VARCHAR(30) NOT NULL, age INT(2) NOT NULL, genre VARCHAR(20) NOT NULL, release VARCHAR(30) NOT NULL, keywords VARCHAR(100) NOT NULL, rating INT(2) NOT NULL, review VARCHAR(1000) NOT NULL, image VARCHAR(30) NOT NULL ) "; it's built up exactly the same way as I've used on my other to MySQL projects... so I dont understand why this one is messing it up for me TIA Regards, Clown Quote Link to comment https://forums.phpfreaks.com/topic/46533-solved-create-table-error-cant-find-it/ Share on other sites More sharing options...
Glyde Posted April 11, 2007 Share Posted April 11, 2007 Release is a MySQL keyword I believe. Try this: $query = " CREATE TABLE movies ( `id` INT(6) NOT NULL auto_increment, `title` VARCHAR(30) NOT NULL, `age` INT(2) NOT NULL, `genre` VARCHAR(20) NOT NULL, `release` VARCHAR(30) NOT NULL, `keywords` VARCHAR(100) NOT NULL, `rating` INT(2) NOT NULL, `review` VARCHAR(1000) NOT NULL, `image` VARCHAR(30) NOT NULL ) "; Quote Link to comment https://forums.phpfreaks.com/topic/46533-solved-create-table-error-cant-find-it/#findComment-226502 Share on other sites More sharing options...
jitesh Posted April 11, 2007 Share Posted April 11, 2007 review VARCHAR(1000) NOT NULL, // You can keep max 255 So review VARCHAR(255) NOT NULL, ----------------------------------------- Or use TEXT or LONGTEXT Quote Link to comment https://forums.phpfreaks.com/topic/46533-solved-create-table-error-cant-find-it/#findComment-226507 Share on other sites More sharing options...
Glyde Posted April 11, 2007 Share Posted April 11, 2007 Didn't even catch that, I just saw the release since that was the first keyword generating the MySQL error. Quote Link to comment https://forums.phpfreaks.com/topic/46533-solved-create-table-error-cant-find-it/#findComment-226512 Share on other sites More sharing options...
jitesh Posted April 11, 2007 Share Posted April 11, 2007 CREATE TABLE movies( `id` INT( 6 ) NOT NULL AUTO_INCREMENT , `title` VARCHAR( 30 ) NOT NULL , `age` INT( 2 ) NOT NULL , `genre` VARCHAR( 20 ) NOT NULL , `release` VARCHAR( 30 ) NOT NULL , `keywords` VARCHAR( 100 ) NOT NULL , `rating` INT( 2 ) NOT NULL , `review` VARCHAR( 255 ) NOT NULL , `image` VARCHAR( 30 ) NOT NULL , PRIMARY KEY ( `id` ) ) --------------------------------------- CREATE TABLE movies( `id` INT( 6 ) NOT NULL AUTO_INCREMENT , `title` VARCHAR( 30 ) NOT NULL , `age` INT( 2 ) NOT NULL , `genre` VARCHAR( 20 ) NOT NULL , `release` VARCHAR( 30 ) NOT NULL , `keywords` VARCHAR( 100 ) NOT NULL , `rating` INT( 2 ) NOT NULL , `review` TEXT NOT NULL , `image` VARCHAR( 30 ) NOT NULL , PRIMARY KEY ( `id` ) ) Quote Link to comment https://forums.phpfreaks.com/topic/46533-solved-create-table-error-cant-find-it/#findComment-226517 Share on other sites More sharing options...
clown[NOR] Posted April 11, 2007 Author Share Posted April 11, 2007 thank you so much for the help guys =) it works like a dream now! ;D Quote Link to comment https://forums.phpfreaks.com/topic/46533-solved-create-table-error-cant-find-it/#findComment-226628 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.