karthik.v29 Posted March 16, 2012 Share Posted March 16, 2012 Hello guys, I have these lines of code echo $_POST['uteamid']; $iddquery1 = mysql_query("Select Driver_ID from Driver where Driver_Name='".$temp."'"); $result = mysql_fetch_assoc($iddquery1); $idquery2 =mysql_query("Select Driver_ID from Driver where Driver_Name='".$_POST['DriverSubst']."'"); $resultidquery2 = mysql_fetch_assoc($idquery2); $replaceid = $result['Driver_ID']; echo $replaceid; $updatequery2 = "Update Team_Driver SET Driver_ID = '".$resultidquery2['Driver_ID']."' where UTeam_ID='".$_POST['uteamid']."' and Driver_ID='".$replaceid."'"; echo $updatequery2; Output of the query is: 5 1 Update Team_Driver SET Driver_ID = '2' where UTeam_ID='5' and Driver_ID='' Why is that last Driver_ID = null? wen it should be 1..and its echoing 1 right before that line. Any help will be appreciated Link to comment https://forums.phpfreaks.com/topic/259038-strange-update-error/ Share on other sites More sharing options...
q11we Posted March 16, 2012 Share Posted March 16, 2012 Code seems fine to me too. Anyway try $updatequery2 = "Update Team_Driver SET Driver_ID = '".$resultidquery2['Driver_ID']."' where UTeam_ID='".$_POST['uteamid']."' and Driver_ID='$replaceid'"; Even though there is no difference.. Link to comment https://forums.phpfreaks.com/topic/259038-strange-update-error/#findComment-1327969 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.