gpt4 book ai didi

php - 在 PHP MYSQL 中更新

转载 作者:太空宇宙 更新时间:2023-11-03 12:20:42 25 4
gpt4 key购买 nike

<分区>

我的更新有问题,我可以理解我的错误在哪里所以,我在数据库中的表:放置 (id,place_number,rezerv)我有一个表格:

<form id="formid" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post"> 
<label>Place :</label>
<select name="place_number" class="place_number" id="place_number">
<option selected="selected">-Select-</option>
</select>
<input name="update" type="submit" id="update" value="Update" />
</form>

还有 php 代码:

   <?php
$link = mysql_connect("localhost", "user", "user")
or die("Can't connect to mysql server");

$db = mysql_select_db("dt_base",$link)
or die("Can't select database");

if(isset($_POST['update']))
{
if($_POST['place_number'])
{
$place_number = $_POST['place_number'];
mysql_query("UPDATE place SET rezerv = 1 WHERE place_number = '$place_number'",$link);
}
}
?>

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com