Checking for an empty record set using php and database

Hi, I’ve been trying to work out how to check for empty record sets. I’ve tried various ways but nothing seems to be working.
What this task is meant to do is extract details of the staff members in the database once you enter a valid staffID. So, even when I type in the correct ID, this error message shows up ‘The staff id provided does not exist
"; exit(); } ?>’ plus the details for the staff show up.

This is what the piece of code looks like for the error message to show up once an invalid ID is entered:

<? require_once ("conn.php"); $rs = mysql_query($dbconn, "select* from staff") or die ('Problem with query' . mysqli_error($dbconn)); $numRecs = mysqli_num_rows ($rs); if ($numRecs==0) { echo "

The staff id provided does not exist

"; exit(); } ?>