Assuming the rep name is always the first and last name appended to each other, just use CONCAT()
to append them and then compare them to your value.
$sql = "SELECT id
FROM contacts
WHERE CONCAT(fname,lname)='" . mysql_real_escape_string($rep_name) . "'
";
I just hope all of your reps have unique first name last name combinations if this is going to be used to authenticate reps in any way.