...etc, etc... 提交到此脚本: include('appvars.php')-6ren">
gpt4 book ai didi

php - 简单的更新查询不起作用?

转载 作者:行者123 更新时间:2023-11-29 08:42:41 24 4
gpt4 key购买 nike

在编写了一大堆更复杂且运行良好的代码之后,这就是给我带来问题的代码。

简单的表格

<form action="res/scripts/editsubscriber.php" method="post">
<label for="name">Name: </label>
<input name="name" type="text" value="<?php echo $name; ?>">
...etc, etc...
</form>

提交到此脚本:

  include('appvars.php');  
if(isset($_POST['submit'])){
$id = $_POST['id'];
$name = $_POST['name'];
$email = $_POST['email'];
$month = $_POST['month'];
$day = $_POST['day'];
$year = $_POST['year'];
$date = $_POST['date'];
$time = substr($date, 0, (stripos($date, " ")+1));
$time = str_replace($time, '', $date);
$created = $year.'-'.$month.'-'.$day.' '.$time;
$query = "UPDATE newslettersubscribers SET name = '$name', email = '$email', created = '$created' WHERE id = $id)";
mysqli_query($dbc, $query);
}

它发布了,我已经回显了所有变量,它们改变得很好,但它仍然不会更新数据库。有人请告诉我我错过了什么......

最佳答案

关于php - 简单的更新查询不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13354058/

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