gpt4 book ai didi

javascript - 第 49 行的 fatal error : Call to a member function fetch_assoc() on a non-object in/home/u161146050/public_html/application/views/test1. php

转载 作者:行者123 更新时间:2023-11-28 08:03:23 24 4
gpt4 key购买 nike

我对这件事有疑问...我一直在 XAMPP 中执行此操作并且没有任何问题...但是每当我将它上传到主机时它总是显示此内容。

Fatal error: Call to a member function fetch_assoc() on a non-object in /home/u161146050/public_html/application/views/test1.php on line 49.

我不知道为什么它会出现在line 49 中,但是在我在localhost 中执行期间它没有出现。

<table class="table table-condensed table-hover">
<tr>
<td class="warning" id="bold">Book Id</td>
<td class="danger" id="bold">Book Title</td>
<td class="warning" id="bold">Author</td>
<td class="danger" id="bold">Status</td>
<td class="warning" id="bold">Borrower</td>
<td class="danger" id="bold">options</td>
</tr>
<?php
include('inc/config.php');
$sql = "SELECT * FROM books";
$result = $link->query($sql);
while($row = $result->fetch_assoc()) {
?>
<tr>
<td class="warning"><?php echo $row['bookNumber']?></td>
<td class="danger"><?php echo $row['title']?></td>
<td class="warning"><?php echo $row['author']?></td>
<td class="danger"><?php echo $row['status']?></td>
<td class="warning"><?php echo $row['borrower']?></td>
<td class="danger"><form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"><div class="btn-toolbar" role="toolbar" aria-label="...">
<div class="btn-group" role="group" aria-label="...">
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-bookmark" aria-hidden="true"></span></button></a>
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></button></a>
</div>
</div>
</form>
</td>
</tr>
<?php }
?>

如有任何帮助,我们将不胜感激。

最佳答案

$result=mysqli_query($con,$sql);
while($row=mysqli_fetch_assoc($result);{

关于javascript - 第 49 行的 fatal error : Call to a member function fetch_assoc() on a non-object in/home/u161146050/public_html/application/views/test1. php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29620472/

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