samedi 5 mai 2018

if statement with while function

I have this code if there are data in sql it works fine but if there is no data i get an error in line 8 but it should stop after line 4-5 and go to that page somebody who can tell me What may be wrong?

<?php
include "../conf/pagebilleder.php";
$hugo = mysqli_num_rows($sql);
if ($hugo < 0){
header("Location: ../index.php");
}
else {
while($row=mysqli_fetch_array($sql2)){ 
}
}
?>

Aucun commentaire:

Enregistrer un commentaire