I have a query that checks if the inserted first name and last name exist in the database or not , I want to make the check for first name and last name or email , So if the inserted first name and last name exist then the user found and if the email only exist in the database then the user is found also , How to do that ?
Here is the code:
$query = "SELECT * FROM users WHERE first_name='" . $f_name . "' AND last_name='" . $l_name . "'";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
if(empty($row)){
//some code to add the user to the database
}else{
//user is found
}
So I want the else mean that either (the first name and last name) or (the email only) doesn't exist in the database