Crew-Portal Posted August 4, 2007 Share Posted August 4, 2007 Can Someone tell me where the error is? #CREATE TABLE AIRCRAFT DROP TABLE IF EXISTS aircraft; CREATE TABLE aircraft ( id INT(11) NOT NULL AUTO_INCREMENT, aircraft NOT NULL VARCHAR(45), short NOT NULL VARCHAR(7), description TEXT, passengers VARCHAR(4), cargo VARCHAR(10), rank VARCHAR(2) ); #CREATE TABLE USERS DROP TABLE IF EXISTS users; CREATE TABLE `users` ( `id` int(11) NOT NULL auto_increment, `username` varchar(255) collate latin1_general_ci NOT NULL, `password` varchar(255) collate latin1_general_ci NOT NULL, `email` varchar(255) collate latin1_general_ci NOT NULL, `ip` varchar(255) collate latin1_general_ci NOT NULL, `name` varchar(255) collate latin1_general_ci NOT NULL, `bday` varchar(255) collate latin1_general_ci NOT NULL, `date` varchar(255) collate latin1_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ; I am getting this 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 'NOT NULL VARCHAR(45), short NOT NULL VARCHAR(7), description TEXT, passengers' at line 3 Quote Link to comment https://forums.phpfreaks.com/topic/63323-solved-mysql-query/ Share on other sites More sharing options...
The Saint Posted August 4, 2007 Share Posted August 4, 2007 CREATE TABLE aircraft ( try taking it out considering itss there twice Quote Link to comment https://forums.phpfreaks.com/topic/63323-solved-mysql-query/#findComment-315553 Share on other sites More sharing options...
Crew-Portal Posted August 4, 2007 Author Share Posted August 4, 2007 # Means Comment As In Not To Affect the Query! Sorry but no Quote Link to comment https://forums.phpfreaks.com/topic/63323-solved-mysql-query/#findComment-315556 Share on other sites More sharing options...
dbo Posted August 4, 2007 Share Posted August 4, 2007 Have you tried putting the data type before the extra attributes? ie VARCHAR(10) NOT NULL instead of NOT NULL VARCHAR(10)? Quote Link to comment https://forums.phpfreaks.com/topic/63323-solved-mysql-query/#findComment-315558 Share on other sites More sharing options...
Crew-Portal Posted August 4, 2007 Author Share Posted August 4, 2007 No Sorry that doesnt work either? Quote Link to comment https://forums.phpfreaks.com/topic/63323-solved-mysql-query/#findComment-315562 Share on other sites More sharing options...
dbo Posted August 4, 2007 Share Posted August 4, 2007 Did you change all instances? And can you post the most recent code? Quote Link to comment https://forums.phpfreaks.com/topic/63323-solved-mysql-query/#findComment-315564 Share on other sites More sharing options...
Crew-Portal Posted August 4, 2007 Author Share Posted August 4, 2007 I changed instances and I still got the same error message? I do not know what is wrong? it looks good but it is not working 80 POST! Quote Link to comment https://forums.phpfreaks.com/topic/63323-solved-mysql-query/#findComment-315566 Share on other sites More sharing options...
dbo Posted August 4, 2007 Share Posted August 4, 2007 Code. Quote Link to comment https://forums.phpfreaks.com/topic/63323-solved-mysql-query/#findComment-315568 Share on other sites More sharing options...
The Saint Posted August 4, 2007 Share Posted August 4, 2007 try this i tested it error came up but the tables where still made CREATE TABLE `aircraft` ( `id` INT( 11 ) NOT NULL , `aircraft` VARCHAR( 45 ) NOT NULL , `short` VARCHAR( 7 ) NOT NULL , `description` TEXT NOT NULL , `passengers` VARCHAR( 4 ) NOT NULL , `cargo` VARCHAR( 10 ) NOT NULL , `rank` VARCHAR( 2 ) NOT NULL ); CREATE TABLE `users` ( `id` INT( 11 ) collate latin1_general_ci NOT NULL, `username` VARCHAR( 255 ) collate latin1_general_ci NOT NULL, `password` VARCHAR( 255 ) collate latin1_general_ci NOT NULL, `email` VARCHAR( 255 ) collate latin1_general_ci NOT NULL, `ip` VARCHAR( 255 ) collate latin1_general_ci NOT NULL, `name` VARCHAR( 255 ) collate latin1_general_ci NOT NULL, `bday` VARCHAR( 255 ) collate latin1_general_ci NOT NULL, `date` VARCHAR( 255 ) collate latin1_general_ci NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ; ); Quote Link to comment https://forums.phpfreaks.com/topic/63323-solved-mysql-query/#findComment-315577 Share on other sites More sharing options...
dbo Posted August 4, 2007 Share Posted August 4, 2007 Just use dbdesigner4... create an "old password type" for your user and connect to the database. Draw your tables out using the graphical tools and tell it to create the tables for you. Banging out SQL create table statements just sucks. Quote Link to comment https://forums.phpfreaks.com/topic/63323-solved-mysql-query/#findComment-315585 Share on other sites More sharing options...
Crew-Portal Posted August 4, 2007 Author Share Posted August 4, 2007 The Saint Got it working it was the DROP IF EXISTS `table` Query that make it stop working! Quote Link to comment https://forums.phpfreaks.com/topic/63323-solved-mysql-query/#findComment-315599 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.