Switch those 2 line:
$rr = $rr->fetch_assoc();
$roV = mysqli_num_rows($rr);
to
$roV = mysqli_num_rows($rr);
$rr = $rr->fetch_assoc();
After the mysqli_fetch_assoc()
call $rr
does not reference the actual MySQLi result resource, but an array representation of its first row, which hast lost all other surrounding information like, e.g., the count of rows returned. That is why mysql_num_rows()
fails to acknowledge $rr
as a valid MySQLi result resource.