Jump to content

Strange update error


karthik.v29

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.