Advertisement
Guest User

Untitled

a guest
Feb 21st, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. function getUsuario($conexion, $usuario, $password) {
  2. $sentencia = "SELECT * FROM alumnos WHERE email='".$usuario."' AND password='".$password."'" like %$usuario%;
  3. $stmt = $conexion->prepare($sentencia);
  4. // Especificamos el fetch mode antes de llamar a fetch()
  5. $stmt->setFetchMode(PDO::FETCH_ASSOC);
  6. // Ejecutamos
  7. $stmt->execute();
  8. // Devolvemos los resultados
  9. return $stmt->fetch();
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement