i'm new to mysqli trying to select everything from a table but num_rows function is returning 0 what am i doing wrong?
here is my code
<?php $conn = new mysqli('localhost', 'root', '', 'paa');
$sql='SELECT * FROM utilisateurs';
$rs=$conn->query($sql);
if($rs === false) {
trigger_error('Wrong SQL: '.$sql.'Error:'.$conn>error,E_USER_ERROR);
} else {
$rows_returned = $rs->num_rows;
echo $rows_returned;
}
?>