Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. $stmt = $conn->mysqli->stmt_init();
  2. $stmt = $conn->mysqli->prepare('SELECT Username, EmailVerified, Blocked FROM user WHERE Email = ? AND SLANumber = ? AND Password = ?');
  3. $stmt->bind_param('ssb', $_POST['EmailID'], $_POST['SLANumber'], $_POST['Password']);
  4. $stmt->execute();
  5. $stmt->store_result();
  6. $result = $stmt->get_result();
  7. if($result->num_rows == 0){
  8. echo 'No rows found';
  9. }
  10. else{
  11. // Continue processing here
  12. .....
  13. }
  14.  
  15. $stmt->execute();
  16. // $stmt->store_result();
  17. $result = $stmt->get_result();
  18. if(result->num_rows == 0){
  19. ...
  20. }
  21.  
  22. $stmt->execute();
  23. // $stmt->store_result();
  24. $result = $stmt->get_result();
  25. if($stmt->affected_rows == 0){
  26. ...
  27. }
  28.  
  29. $result = $stmt->get_result();
  30.  
  31. // Also check strict comparison against int 0,
  32. // to avoid incorrect equality with boolean FALSE
  33. if($result->num_rows === 0){
  34. echo 'No rows found';
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement