I'm trying to count the rows returned from a query in mysqli, I know I supplied the correct user id and password but it keeps on returning 0 for the number of rows returned. I even echoed out the user id and the hashed password that I'm binding to the query then supplied it in heidiSql, and I got a single row returned.
if($query = $db->prepare("SELECT user_id, pword_hash FROM tbl_users WHERE user_id=? AND pword_hash=?")){
$query->bind_param("ss", $user_id, $hash);
$query->execute();
echo $query->num_rows;
if($query->num_rows > 0){
echo 1;
}
}