我有一个 mysql 脚本需要在 php 中运行,我尝试过,但没有成功。有人可以帮我吗?
我也尝试使用 mysqli_multi_query,但它也不起作用。
<?php
include 'connection.php';
if(isset($_GET["action"])&&($_GET["action"]=="versave")){
$gp_name = $_GET['gp_name'];
$version = $_GET['version'];
$query_vers = "CREATE TEMPORARY TABLE tmp SELECT * from `gp_info` WHERE `gp_name`= $gp_name";
$query_vers .= "UPDATE tmp SET `version` = $version";
$query_vers .= "ALTER TABLE tmp DROP id";
$query_vers .= "INSERT INTO `gp_info` SELECT 0, tmp.* FROM tmp";
$query_vers .= "DROP TABLE tmp";
mysqli_multi_query($connect, $query_vers);
header("Location: gp_data.php");
}
?>
<form id="verForm" name="versaveForm" method="get">
<input type="hidden" name="action" value="versave">
<div>
<input type="text" id="gp_name" name="gp_name">
<input type="text" id="version" name="version">
</div>
<input type="submit" name="vers" value="Version" id="versave">
</form>
翻阅古今
守着星空守着你
慕田峪7331174