I have a problem when checking if email allready exists in the database.
<?php
session_start();
include_once("connection.php");
$handler = new Connection;
$handler = $handler->connect();
$email = $_POST['email'];
$check = $handler->prepare("SELECT * FROM emailcollector WHERE email=':mail'");
$check->execute(array(':mail' => $email));
if($check->rowCount > 0){
header("Location: yes.php");
}else{
header("Location: no.php");
}
?>
Im using a pdo connection to the database. When i run the code it allways says that it does not exist. Im kinda new to this. Thanks for any help