i need help in following query,
how to check this email alreadyexist in our db or not.
var_dump($email);
output: array(2) {
[0]=>
string(22) "xxxx7@gmail.com"
[1]=>
string(19) "yyyyy@gmail.com"
}
foreach($email as $em)
{
$sql = "SELECT *
from sf_guard_user sf,personal pi
where pi.user_id = sf.id
and sf.email_address = '$em'
";
$query = $db->prepare($sql);
$query->execute();
$alreadyexist[$count++] = $query->fetchAll();
}
this two emails exist in our db. but fectching only one array,
plz help me.what is the problem in my foreach loop.