how would i merge the following two sql select statements?
//select all rows from our userlogin table where the emails match
$res1 = mysql_query("SELECT *
FROM userlogin
WHERE `email` = '".$email."'");
$num1 = mysql_num_rows($res1);
//if the number of matchs is 1
if($num1 == 1) {
//the email address supplied is taken so display error message
echo '<p class="c7">The <b>e-mail</b> address you supplied is already taken. Please go <a href="register.php">back</a> and try again.<br><img src="resources/img/spacer.gif" alt="" width="1" height="15"></p>';
include_once ("resources/php/footer.php");
exit;
} else {
//select all rows from our userlogin_fb table where the emails match
$res2 = mysql_query("SELECT *
FROM userlogin_fb
WHERE `email` = '".$email."'");
$num2 = mysql_num_rows($res2);
//if the number of matchs is 1
if($num2 == 1) {
//the email address supplied is taken so display error message
echo '<p class="c7">The <b>e-mail</b> address you supplied is already taken. Please go <a href="register.php">back</a> and try again.<br><img src="resources/img/spacer.gif" alt="" width="1" height="15"></p>';
include_once ("resources/php/footer.php");
exit;
} else {;}
Use: