我有这段代码,如果sql中有数据,它工作得很好,但是如果没有数据,我会在第8行得到一个错误,但是它应该在第4-5行之后停止,并转到那个页面,有人可以告诉我哪里可能是错误的?
<?php
include "../conf/pagebilleder.php";
$hugo = mysqli_num_rows($sql);
if ($hugo < 0){
header("Location: ../index.php");
}
else {
while($row=mysqli_fetch_array($sql2)){
}
}
?>发布于 2018-05-06 02:00:36
if不应该是一个等号的if语句吗?因为如果它是0,它应该转到索引?
if ($hugo <= 0){
header("Location: ../index.php");
}https://stackoverflow.com/questions/50192482
复制相似问题