I have joined two SQL Queries using SQL UNION Operator
Example:
$query1 = "SELECT * FROM employees WHERE emp_first_name LIKE '%Donald%'";
$query2 = "SELECT * FROM employees WHERE emp_last_name LIKE '%George%'";
$final_query = $query1 . " UNION " . $query2
When I Run this $final_query, it shows the results of both queries if the first query's result set is not empty. If the first query has empty result set there will be no result shown even if second query has some values in the database.
Can some one explain where is the problem.
Note: Don't suggest me the use of single query, i have a reason to use two queries.