gpt4 book ai didi

php - 如何在 php 中循环更新查询并显示它,使其像日志历史记录一样

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

<?php
include('core/init.php');//database connection


if(isset($_POST['btn_submit'])){
$sqlQuery = mysql_query("UPDATE `position` SET `ATR`='".mysql_real_escape_string($_POST['ATR'])."',
$resultQuery = mysql_query($connection, $sqlQuery) or die (mysql_error($connection));

if(mysql_affected_rows($resultQuery) > 0){
echo "updated";
}else{
echo "failed";
}
header('Location:position2.php');
$result = mysql_query("SELECT * FROM position WHERE ID='" .$_POST["id"]. "'");
$row2 = mysql_fetch_array($result);
}
?>

//这段代码的作用是根据用户输入更新数据库,我试图循环每个用户输入作为更新和显示,但它似乎不起作用

最佳答案

($_POST['ATR'])."',缺少结束语“此外,格式化代码使其更易于阅读和调试。

关于php - 如何在 php 中循环更新查询并显示它,使其像日志历史记录一样,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38338991/

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