【发布时间】:2019-03-04 22:27:21
【问题描述】:
我无法弄清楚这里出了什么问题,我正在尝试显示我的数据库结果,它给了我这个错误,有什么问题?
<?php
$mysqli = new mysqli("localhost","root","","fakultet");
if ($mysqli->error) {
die("Greska :".$mysqli->error);
}
$upit = "Select * from student WHERE sifra>165";
$rez = mysqli_query($mysqli,$upit);
?>
<html>
<head>
<title></title>
</head>
<body>
<table width="600" border="1" cellpadding="1" cellspacing="1">
<tr>
<th>BrInd</th>
<th>Prezime</th>
<th>Ime</th>
<th>status</th>
<th>sifra</th>
</tr>
<?php
while ($kokoš=mysqli_fetch_assoc($rez)) {
echo "<tr>";
echo "<td>".$rez['BrInd']."</td>";
echo "<td>".$rez['Prezime']."</td>";
echo "<td>".$rez['Ime']."</td>";
echo "<td>".$rez['status']."</td>";
echo "<td>".$rez['sifra']."</td>";
echo "</tr>";
# code...
}
?>
</table>
</body>
</html>
我不是专家,我只是想学习它,但这让我很头疼。 非常感谢您!
【问题讨论】:
-
mysqli_error($mysqli)上查询显示什么?和错误报告