vendredi 8 février 2019

PHP Check if something is in DB

<?php 

include'Database.php';

try{
    $db = DBConnector();
} catch{
    echo 'Connection to MySQL failed.';
}

$email = $_GET['email'];

if(isset($_GET['email'])) {
    try{
        $statement = $database->prepare('SELECT * FROM antipublic_db WHERE 'email' = $email');
        $statement->execute();
        $count = $statement->rowCount();
     if($count > 0){
         echo 'Public';
    }else{
        echo 'Private';
    }
}catch () {
    echo 'Error checking';
}

}
?>

I coded this but it doesn't work. My DB Connection is fine

I hope someone can help me with this :=)

I need to write more because this is some rule lmao, it doesnt let me post

Aucun commentaire:

Enregistrer un commentaire