如何更新临时数据库中的列

时间:2015-03-31 02:54:28

标签: php mysql sql-update sql-insert

我需要从mySQL中创建的临时数据库更新列。我试图改变变量,但它不起作用。这是我的剧本:

$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");

当我打印UPDATE tmptable_2 SET prop_sid ='$sid'时,它正确显示$sid。但是当它插入数据库时​​,它仍然是来自sid的{​​{1}}。

0 个答案:

没有答案