0

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.';
        }
2
Contributors
3
Replies
14
Views
2 Years
Discussion Span
Last Post by blueguy777
0

yes all three variables having values

$username = $_POST["user_name];
$email = $_POST["email];
$mobile = $_POST["mobile];
0
$username = $_POST["user_name"];
$email = $_POST["email"];
$mobile = $_POST["mobile"];
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.