Jump to content

Give new value to variable from MYSQL UPDATE statement


nightkarnation

Recommended Posts

Please take a look at the following code (this would work if the statement was SELECT instead of UPDATE) But I need to grab the following:

 

$result = mysql_query("UPDATE `AUCTIONS_MAIN` SET Current_Price = Current_Price + '$increase_price', Last_Bidder_Time = '$last_bidder_time' WHERE PId = '$id'");
//grab the new updated current price to save on different bidding history DB
 while($row=mysql_fetch_array($result))
{
	$current_price = $row['Current_Price'];
   	}

 

As you can see, I need to give the new Current_Price value to the $current_price variable.

Obviously the while function is incorrect,

I would really appreciate any ideas and/or suggestions on how I can grab this value.

 

PS: I can't make a new query call with a select statement in order to know the new Current_Price. I need the direct updated value coming from the Update Statement, is this possible?

 

Thanks a lot in advance!!

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.