Dethman Posted October 12, 2009 Share Posted October 12, 2009 here is the error: Unknown column 'e_mail' in 'where clause'INSERT INTO `AccountDetails` (userName,race,e_mail,password,commander,active,uniqueLink) VALUES ('El Presidente','0','brianflores@ultimateconquest.com','00749359','','0','ug1255310986') here is the code, any help would be cool, function createUser($userName,$race,$e_mail,$password,$commander,$active=0,$uniqueLink="",$fortificationLevel=0,$siegeLevel=0, $gold=2800,$lastTurnTime=0,$attackTurns=17,$currentUnitProduction=0,$currentSpySkill=0, $trainedAttackSold=0,$trainedAttackMerc=0,$trainedDefSold=0,$trainedDefMerc=0,$untrainedSold=1,$untrainedMerc=0,$spies=0){ if (!$lastTurnTime){$lastTurnTime=time();} $uniqueLink=genUniqueLink(); $str = "INSERT INTO `AccountDetails` (userName,race,e_mail,password,commander,active,uniqueLink) VALUES ('$userName','$race','$e_mail','$password','$commander','$active','$uniqueLink')"; echo "$str<br>"; $q = @mysql_query($str); if (!$q) { print ('Query failed 1: '.mysql_error()); return; } $us=getUserDetailsByName($userName); $userID=$us->ID; $str2 = "INSERT INTO `UserDetails` (fortificationLevel,siegeLevel, gold,lastTurnTime,attackTurns,currentUnitProduction,currentSpySkill, trainedAttackSold,trainedAttackMerc,trainedDefSold,trainedDefMerc,untrainedSold,untrainedMerc,spies,ownerID) VALUES ('$fortificationLevel','$siegeLevel', '$gold','$lastTurnTime','$attackTurns','$currentUnitProduction','$currentSpySkill', '$trainedAttackSold','$trainedAttackMerc','$trainedDefSold','$trainedDefMerc','$untrainedSold','$untrainedMerc','$spies','$userID')"; $q = @mysql_query($str2); if (!$q) { print ('Query failed 2: '.mysql_error()); return; } $str= "INSERT INTO `Ranks` (userID) VALUES ('$userID') "; $q = @mysql_query($str); return $q; } Thanks for any help I cannot figure out why is gives that error. Quote Link to comment https://forums.phpfreaks.com/topic/177366-register-function-error-plz-help/ Share on other sites More sharing options...
sKunKbad Posted October 12, 2009 Share Posted October 12, 2009 Do you actually have a column/field in your table named e_mail? Quote Link to comment https://forums.phpfreaks.com/topic/177366-register-function-error-plz-help/#findComment-935188 Share on other sites More sharing options...
PFMaBiSmAd Posted October 12, 2009 Share Posted October 12, 2009 The Unknown column 'e_mail' in 'where clause' is from some previous query on the page and the rest of what you printed is from your echo "$str<br>"; statement. You would need to identify the query that is causing the Unknown column 'e_mail' in 'where clause' error to be output. Quote Link to comment https://forums.phpfreaks.com/topic/177366-register-function-error-plz-help/#findComment-935189 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.