Código PHP:
Ver original
<?php $host = "localhost"; $dbname = "publicalibre"; $dbuser = "root"; $password = ""; //Abrir conexion SQL class Usuario{ public $Query; public $SQL; public $Result; public $numrows; //Constructor function Usuario(){ $this->Query = ""; $this->SQL = ""; $this->Result = ""; $this->numrows = ""; } //Verificamos si existe un email repetido. function consultarEmail($email){ try{ $email = $email; //$dbConectar = new Conexion(); //$dbCon = $dbConectar->conectarClasico(); //Inicia la transacción. $this->SQL = "SELECT * FROM registrarion WHERE email'$email'"; return $this->numrows; }catch(Exception $e){ return false; } } } $comprobar = new Usuario; echo $comprobar->consultarEmail($email); ?>
Me arroja este error :
Código Error:
Ver original
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\web\models\Usuario.php on line 41
La conexion a MySQL está correcta!
Help Me. ThankS!