PHP Login Code not working properly any suggestions? -
i have been working on login page , code has not been working, have tips or ideas on should do. when echo num_rows displays 0, instead of number of rows in database.
$email = mysqli_real_escape_string($dbc, trim($_post['email'])); $password = mysqli_real_escape_string($dbc, trim($_post['password'])); //look email , password in database $query = "select * users email = '$email' , password = md5('$password')"; $data = mysqli_query($dbc, $query); $count = mysqli_num_rows($data); echo "num of rows: " . $count . "<br/>";
change password statement , query this. it'll solve problem
$password = md5($_post['password']);
$query = "select * users email = '$email' , password = '$password'";
Comments
Post a Comment