gpt4 book ai didi

php - 给出警告 : mysqli_free_result() expects parameter 1 to be mysqli_result, bool 值

转载 作者:可可西里 更新时间:2023-10-31 22:41:56 28 4
gpt4 key购买 nike

为什么我会收到此错误消息:

Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given

我的代码是:

$statement = "INSERT INTO table1 (data1, data2) VALUES ('$variable1', '$variable2')";

if ($result = mysqli_query($conn,$statement)) {
echo "New record added successfully";
} else {
echo "Error adding records: " . $result . "<br>" . mysqli_error($conn);
}

echo "Adding records finished. ";

mysqli_free_result($result);

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