refining logic statements into mysqli_num_rows()