Advertisement
Guest User

Untitled

a guest
Feb 1st, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. if($connection){
  2.  
  3. $username = "admin";
  4. $password = "admin";
  5.  
  6. $statement = mysqli_prepare($connection,"SELECT * FROM `admin` WHERE username = ? AND password = ?");
  7.  
  8. mysqli_stmt_bind_param($statement,"ss",$username,$password);
  9. mysqli_stmt_execute($statement);
  10.  
  11. if(mysqli_affected_rows($connection) == 1){
  12. $response = array('response'=>true);
  13. }else{
  14. $response = array('response'=>false);
  15. }
  16.  
  17. echo json_encode($response);
  18.  
  19. mysqli_stmt_close($statement);
  20. mysqli_close($connection); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement