I'm inserting users into the database and clicking "submit" on the form says to insert the email and this email already exists.
I've been analyzing I changed [rowCount()>=0]
to [rowCount()>=1]
, gave
Internal error 1 while checking email
I mean, never validate the email, I'm grateful!
require_once( '../../site/classes/DB.class.php' );
if($_SERVER['REQUEST_METHOD'] == 'POST' ) {
$email = $_POST['email'];
$erro = '';
$verificar = DB::getConn()->prepare("SELECT 'id' FROM 'usuarios' WHERE 'email'=?");
if( $verificar->execute( array( $email) ) ) {
if( $verificar->rowCount()>=0){
$erro .= 'Este e-mail ja existe<br>';
} else {
$erro .= 'Erro interno 1 ao verificar o e-mail<br>';
}
} else {
$erro .= 'Erro interno 2 ao verificar o e-mail<br>';
}
? >