Monkey644 Posted September 10, 2010 Share Posted September 10, 2010 Hi everyone, I get the following error message when someone on my game tries to create a gang. I have replaced the entire gang pages and sqls with a backup copy i had, but still had no success. The error message is: 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 'test','testing gang system','','',0,0,100,1,1,5,0,0,'')', '/creategang.php', uni' at line 2 MySQL Version is: 5.0.91-community Can anyone help me at all? Quote Link to comment Share on other sites More sharing options...
dementor Posted September 10, 2010 Share Posted September 10, 2010 Did you anything to gangs in the database ? Like gang pictures or something ? Quote Link to comment Share on other sites More sharing options...
furn355 Posted September 10, 2010 Share Posted September 10, 2010 post your insert query and tell us how many columns you have in the gangtable. Quote Link to comment Share on other sites More sharing options...
Monkey644 Posted September 10, 2010 Author Share Posted September 10, 2010 As requested. $db->query("INSERT INTO gangs VALUES('','$name','$desc','','',0,0,100,$userid,$userid,5,0,0,'')"); And this is my gang table sql: [mysql]CREATE TABLE IF NOT EXISTS `gangs` ( `gangID` int(11) NOT NULL auto_increment, `gangNAME` varchar(255) NOT NULL default '', `gangDESC` text NOT NULL, `gangPREF` varchar(12) NOT NULL default '', `gangSUFF` varchar(12) NOT NULL default '', `gangMONEY` bigint(65) NOT NULL default '0', `gangCRYSTALS` bigint(65) NOT NULL default '0', `gangRESPECT` int(11) NOT NULL default '0', `gangPRESIDENT` int(11) NOT NULL default '0', `gangVICEPRES` int(11) NOT NULL default '0', `gangCAPACITY` int(11) NOT NULL default '0', `gangCRIME` int(11) NOT NULL default '0', `gangCHOURS` int(11) NOT NULL default '0', `gangAMENT` longtext NOT NULL, `gangSIG` varchar(255) NOT NULL, `gangSIG2` varchar(255) NOT NULL, `gangSTATUS` text NOT NULL, PRIMARY KEY (`gangID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=27 ;[/mysql] Quote Link to comment Share on other sites More sharing options...
Guest Paddy- Posted September 10, 2010 Share Posted September 10, 2010 Count the Values in the query then count the rows in the Table do they match? that might be the problem! Quote Link to comment Share on other sites More sharing options...
Armageddon Posted September 10, 2010 Share Posted September 10, 2010 Could you post all the code up please? Also, I think something need's to be added inbetween the empty ",",",. Quote Link to comment Share on other sites More sharing options...
Analog Posted September 10, 2010 Share Posted September 10, 2010 Your table has 17 fields in it. Your insert SQL only contains 13. [mysql] CREATE TABLE IF NOT EXISTS `gangs` ( `gangID` int(11) NOT NULL auto_increment, `gangNAME` varchar(255) NOT NULL default '', `gangDESC` text NOT NULL, `gangPREF` varchar(12) NOT NULL default '', `gangSUFF` varchar(12) NOT NULL default '', `gangMONEY` bigint(65) NOT NULL default '0', `gangCRYSTALS` bigint(65) NOT NULL default '0', `gangRESPECT` int(11) NOT NULL default '0', `gangPRESIDENT` int(11) NOT NULL default '0', `gangVICEPRES` int(11) NOT NULL default '0', `gangCAPACITY` int(11) NOT NULL default '0', `gangCRIME` int(11) NOT NULL default '0', `gangCHOURS` int(11) NOT NULL default '0', `gangAMENT` longtext NOT NULL, `gangSIG` varchar(255) NOT NULL, `gangSIG2` varchar(255) NOT NULL, `gangSTATUS` text NOT NULL, PRIMARY KEY (`gangID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=27 ; [/mysql] Try this for your insert sql [mysql] $db->query("INSERT INTO gangs VALUES('', '$name', '$desc', '', '', 0, 0, 100, $userid, 0, 5, 0, 0, '', '', '', 0)"); [/mysql] Quote Link to comment Share on other sites More sharing options...
Monkey644 Posted September 12, 2010 Author Share Posted September 12, 2010 $db->query("INSERT INTO gangs VALUES('', '$name', '$desc', '', '', 0, 0, 100, $userid, 0, 5, 0, 0, '', '', '', 0)"); Your table has 17 fields in it. Your insert SQL only contains 13. [mysql] CREATE TABLE IF NOT EXISTS `gangs` ( `gangID` int(11) NOT NULL auto_increment, `gangNAME` varchar(255) NOT NULL default '', `gangDESC` text NOT NULL, `gangPREF` varchar(12) NOT NULL default '', `gangSUFF` varchar(12) NOT NULL default '', `gangMONEY` bigint(65) NOT NULL default '0', `gangCRYSTALS` bigint(65) NOT NULL default '0', `gangRESPECT` int(11) NOT NULL default '0', `gangPRESIDENT` int(11) NOT NULL default '0', `gangVICEPRES` int(11) NOT NULL default '0', `gangCAPACITY` int(11) NOT NULL default '0', `gangCRIME` int(11) NOT NULL default '0', `gangCHOURS` int(11) NOT NULL default '0', `gangAMENT` longtext NOT NULL, `gangSIG` varchar(255) NOT NULL, `gangSIG2` varchar(255) NOT NULL, `gangSTATUS` text NOT NULL, PRIMARY KEY (`gangID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=27 ; [/mysql] Try this for your insert sql [mysql] $db->query("INSERT INTO gangs VALUES('', '$name', '$desc', '', '', 0, 0, 100, $userid, 0, 5, 0, 0, '', '', '', 0)"); [/mysql] OMG Your a Legend!!! Works perfectly :) Thank you all for youe help!!! Quote Link to comment 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.