I need to update a column from a temporary database created in mySQL. I've tried to change the variable but it's not work. Here's my script:
$sid=md5(time());//new value
mysqli_query($con,"CREATE TEMPORARY TABLE tmptable_2 SELECT * FROM prop_itinerary WHERE prop_sid = '$_GET[sid]'");
mysqli_query($con,"UPDATE tmptable_2 SET prop_sid ='$sid'");//this is where I need to change the prop_sid from the original 'prop_itineraty.prop_sid'
mysqli_query($con,"INSERT INTO prop_itinerary SELECT * FROM tmptable_2");
mysqli_query($con,"DROP TEMPORARY TABLE IF EXISTS tmptable_2");
When I print out UPDATE tmptable_2 SET prop_sid ='$sid'
it turns out the $sid
correctly. But still when it inserted into DB it is a sid
from prop_itinerary.prop_sid
.