Unable to execute code, displaying blank page.
$q = 'SELECT id,username,email,mobile FROM users WHERE email=:email OR mobile=:mobile';
$query = $dbh->prepare($q);
$query->execute(array(':username' => $username, ':email' => $email,':mobile' => $mobile));
if($query->rowCount() == 0){
while($row = $query->fetch(PDO::FETCH_ASSOC)){
if($row[2] == $email) {
if($row[3] == $mobile) {
echo 'Mobile Number and Email are already registered with us.';
}
echo 'Email is already registered with us';
}
echo 'Mobile Number is already registered with us';
}
}
else{ $q = 'INSERT INTO users(username,password,url,name,email,address,mobile,ip,dob) VALUES(:username,:password,:url,:name,:email,:address,:mobile,:ip,:dob)';
$query = $dbh->prepare($q);
$query->execute(array(':username' => $username, ':password' => $password, ':url' => $url, ':name' => $name, ':email' => $email, ':address' => $address, ':mobile' => $mobile, ':ip' => $ip, ':dob' => $dob));
echo 'User Registered Successfully.';
}