0

why is the code below is not working?

$sql = "SELECT password, fullname, active FROM ".$mysql_table."";
   $sql = $sql . "WHERE username = :username, password = :password";
   $statement = $pdo->prepare($sql);
   $statement->bindValue(':username', $_POST['username']);
   $statement->bindValue(':password', md5($_POST['password']));
   $statement->execute();
2
Contributors
2
Replies
13
Views
4 Years
Discussion Span
Last Post by minitauros
0

solved it with

$sql = "SELECT password, fullname, active FROM ".$mysql_table." WHERE username = :username AND password = :password";
   $statement = $pdo->prepare($sql);
   $statement->bindValue(':username', $_POST['username']);
   $statement->bindValue(':password', md5($_POST['password']));
   $statement->execute();
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.