gpt4 book ai didi

php - MySQL 使用 PHP

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

我在正确运行此 php 脚本时遇到问题。

“redirect_to()”和“$link”均在附加文件中定义。

任何提示将不胜感激。

if (isset($_POST['submit'])) {
$id = $_GET["section"];

$about_me = "../include/about_me.php";

$providers_2 = "../include/2providers.php";

$more_providers = "../include/more_proiders.php";

$section_change = $_POST["section_change"];

$query = "UPDATE sections SET ":
$query .= "`File Path` = '{$section_change}' ";
$query .= "WHERE id = '{$id}' ";
$query .= "LIMIT 1";
$result = mysqli_query($link, $query);

if ($result && mysqli_affected_rows($link) == 1) {
// Success
$_SESSION["message"] = "Section Changed.";
redirect_to("../index.php?admin=true");
} else {
// Failure
echo "System Failure. Please try again later. If problem persists please notify your admin at aqeke.com/powerplaylife-help"
}
}
else {
print_r( $_POST);

}

最佳答案

试试这个。

你有

  1. :代替;
  2. 额外的大括号 。您在“系统故障”行末尾缺少一个分号。

以后,您可以使用格式化工具来帮助您快速诊断问题 - http://beta.phpformatter.com/

<?php


if (isset($_POST['submit'])) {
$id = $_GET["section"];

$about_me = "../include/about_me.php";

$providers_2 = "../include/2providers.php";

$more_providers = "../include/more_proiders.php";

$section_change = $_POST["section_change"];

$query = "UPDATE sections SET ";
$query .= "`File Path` = '{$section_change}' ";
$query .= "WHERE id = '{$id}' ";
$query .= "LIMIT 1";
$result = mysqli_query($link, $query);

if ($result && mysqli_affected_rows($link) == 1) {
// Success
$_SESSION["message"] = "Section Changed.";
redirect_to("../index.php?admin=true");
} else {
// Failure
echo "System Failure. Please try again later. If problem persists please notify your admin at aqeke.com/powerplaylife-help";
}
} else {
print_r($_POST);

}

?>

关于php - MySQL 使用 PHP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46475499/

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