How do I output the number of returned rows using mysqli? My code below shows 0 though a while loop (while $s->fetch() echo $uid;) shows 2 results;
$m = new
You'll have to call mysqli_stmt::store_result() after mysqli_stmt::execute() and before fetch in order to know mysqli_stmt::num_rows:
mysqli_stmt::store_result()
mysqli_stmt::execute()
mysqli_stmt::num_rows
$s->execute(); $s->store_result(); print_r($s->num_rows);
PHP Document on num_rows
PHP Document on store_result()