note 129878 added to class.mysqli-stmt
| From: | Anonymous | Date: | Tue, 26 Nov 2024 14:04:48 +0000 |
| Subject: | note 129878 added to class.mysqli-stmt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221679@lists.php.net to get a copy of this message | ||
class Dao
{
private $conexion;
public function __construct($conexion)
{
$this->conexion = $conexion;
}
public function obtenerUsuarioEmail($emailUsuario, $passwordUsuario)
{
try {
$sql = "SELECT password FROM usuario WHERE email = :email";
$stmt = $this->conexion->prepare($sql);
$stmt->bindValue(':email', $emailUsuario, PDO::PARAM_STR);
$stmt->execute();
$usuario = $stmt->fetch(PDO::FETCH_ASSOC);
if ($usuario && password_verify($passwordUsuario,
$usuario['password'])) {
return true;
}
return false;
} catch (PDOException $e) {
// Mostrar el error en un entorno de desarrollo
echo "Error en la consulta: " . $e->getMessage();
return false;
}
}
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 31.4.134.44)
----
Manual Page -- https://php.net/manual/en/class.mysqli-stmt.php
Edit -- https://main.php.net/note/edit/129878
Del: integrated -- https://main.php.net/note/delete/129878/integrated
Del: useless -- https://main.php.net/note/delete/129878/useless
Del: bad code -- https://main.php.net/note/delete/129878/bad+code
Del: spam -- https://main.php.net/note/delete/129878/spam
Del: non-english -- https://main.php.net/note/delete/129878/non-english
Del: in docs -- https://main.php.net/note/delete/129878/in+docs
Del: other reasons-- https://main.php.net/note/delete/129878
Reject -- https://main.php.net/note/reject/129878
Search -- https://main.php.net/manage/user-notes.php