我收到错误:
Warning: mysqli_query(): Couldn't fetch mysqli in /Users/phillipjordan/Desktop/Amatak/mule/settings/index.php on line 97
我不知道为什么,因为我的代码:
<?php
$host = "localhost";
$user = "root";
$password = "_______";
$port = 8889;
$db = "****";
$conn = new mysqli($host, $user, $password, $db);
ini_set("display_errors", 1);
if ($conn->connect_error) {
die("not working");
die();
}
?>
*other code*
$settingsquery = mysqli_query($conn, "SELECT * FROM settings WHERE userid=".$_SESSION["id"]);
$setting = mysqli_fetch_assoc($settingsquery);
看起来很健康,有人可以帮忙吗?似乎错误来自mysqli_query()函数。我无法发布更多代码,因为stackoverflow不会让我。
答案 0 :(得分:0)
没关系,我犯了一个愚蠢的错误,我把$ conn-&gt; close();在功能之前,不好意思浪费你的时间。