LOUDMOUTH Posted March 24, 2010 Share Posted March 24, 2010 I am trying to query this and am getting a syntax error, am I doing this completely wrong? haha query -- Table structure for table `adds` CREATE TABLE IF NOT EXISTS `adds` ( `id` int(10) NOT NULL auto_increment=1, `fid` int(15) default NULL, `added` int(15) defaultNULL, PRIMARY KEY (`id`), KEY `fid` (`fid`) ) TYPE=MyISAM AUTO_INCREMENT=2058469 ; -- Dumping data for table `adds` -- Table structure for table `admin` -- CREATE TABLE IF NOT EXISTS `admin` ( `id` int(10) NOT NULL auto_increment, `admin` varchar(10) NOT NULL, `password` varchar(20) NOT NULL, PRIMARY KEY (`id`) ) TYPE=MyISAM AUTO_INCREMENT=2 ; -- -- Dumping data for table `admin` -- INSERT INTO `admin` (`id`, `username`, `password`) VALUES (1, 'username', 'password'); error i am getting Error SQL query: -- Table structure for table `adds` CREATE TABLE IF NOT EXISTS `adds` ( `id` int( 10 ) NOT NULL AUTO_INCREMENT =1, `fid` int( 15 ) default NULL , `added` int( 15 ) defaultNULL, PRIMARY KEY ( `id` ) , KEY `fid` ( `fid` ) ) TYPE = MYISAM AUTO_INCREMENT =2058469; MySQL said: Documentation #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 '=1, `fid` int(15) default NULL, `added` int(15) defaultNULL, PRIMARY KE' at line 2 Link to comment https://forums.phpfreaks.com/topic/196341-syntx-error/ Share on other sites More sharing options...
Daniel0 Posted March 24, 2010 Share Posted March 24, 2010 Uh... how about reading the error message? #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 '=1, `fid` int(15) default NULL, `added` int(15) defaultNULL, PRIMARY KE' at line 2 Does this look correct to you? `added` int(15) defaultNULL, Link to comment https://forums.phpfreaks.com/topic/196341-syntx-error/#findComment-1030969 Share on other sites More sharing options...
LOUDMOUTH Posted March 24, 2010 Author Share Posted March 24, 2010 Dont know much about this is why I am asking, looks to me like there should be a space in between, but still throws error Link to comment https://forums.phpfreaks.com/topic/196341-syntx-error/#findComment-1030971 Share on other sites More sharing options...
ScotDiddle Posted March 24, 2010 Share Posted March 24, 2010 LOUDMOUTH, I took out the =1 from your autoincrement parmater, and added the missing space, ran the altered code throught phpMyAdmin's SQL parser and got a valid table defined. CREATE TABLE IF NOT EXISTS `adds` (`id` int( 10 ) NOT NULL AUTO_INCREMENT,`fid` int( 15 ) default NULL ,`added` int( 15 ) default NULL,PRIMARY KEY ( `id` ) ,KEY `fid` ( `fid` )) TYPE = MYISAM AUTO_INCREMENT =2058469 Scot L. Diddle, Richmond VA Link to comment https://forums.phpfreaks.com/topic/196341-syntx-error/#findComment-1030975 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.