Dethman Posted October 6, 2009 Share Posted October 6, 2009 Here is my Error please help, 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 '','0','[email protected]','83694713','','0','sc1254809263')' at line 1 Here is my Code. $str2 = "INSERT INTO `AccountDetails` (userName,race,e_mail,passwprd,commander,active,uniqueLink) VALUES ($userName','$race','$e_mail','$password','$commander','$active','$uniqueLink')"; $str = "INSERT INTO `UserDetails` (fortificationLevel,siegeLevel,gold,lastTurnTime,attackTurns,currentUnitProduction,currentSpySkill,trainedAttackSold,trainedAttackMerc,trainedDefSold,trainedDefMerc,untrainedSold,untrainedMerc,spies,owner) VALUES ('$fortificationLevel','$siegeLevel','$gold','$lastTurnTime','$attackTurns','$currentUnitProduction','$currentSpySkill','$trainedAttackSold','$trainedAttackMerc','$trainedDefSold','$trainedDefMerc','$untrainedSold','$untrainedMerc','$spies','$accontID')"; $q = @mysql_query($str2); if (!$q) { print ('Query failed: '.mysql_error()); return; } $us=getAccountByName($userName); $accountID=$us->ID; $q = @mysql_query($str); if (!$q) { print ('Query failed: '.mysql_error()); return; } Any Help would be Nice Link to comment https://forums.phpfreaks.com/topic/176654-solved-insertion/ Share on other sites More sharing options...
Daniel0 Posted October 6, 2009 Share Posted October 6, 2009 VALUES ($userName','$race' Notice anything wrong? Link to comment https://forums.phpfreaks.com/topic/176654-solved-insertion/#findComment-931335 Share on other sites More sharing options...
Dethman Posted October 6, 2009 Author Share Posted October 6, 2009 No, I still dont see anything wrong, but I wrote it a different way and solved it. Link to comment https://forums.phpfreaks.com/topic/176654-solved-insertion/#findComment-931339 Share on other sites More sharing options...
cags Posted October 6, 2009 Share Posted October 6, 2009 <hint>missing single quote before $userName</hint> Link to comment https://forums.phpfreaks.com/topic/176654-solved-insertion/#findComment-931363 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.