当我运行此查询时,我收到
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/morgan58/public_html/wow/includes/index/index_admin.php on line 188
SELECT * FROM characters WHERE id=5
Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /home/morgan58/public_html/wow/includes/index/index_admin.php on line 194
查询正在运行,它正在尝试选择正确的信息,但是对于实际输出,它给了我一个 fetch_array 错误;如果有人能看到错误所在,将不胜感激。谢谢你。
<?php
$adminid= $admin->get_id();
$characterdb= 'characters';
$link = mysqli_connect("$server", "$user", "$pass", "$characterdb");
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT * FROM characters WHERE id=$adminid";
$result = mysqli_query($link, $query);
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
{
echo $query;
echo $row['name'];
}
mysqli_free_result($result);
mysqli_close($link);
?>