Guest User

Untitled

a guest
Jul 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. public function query($res, $pass_no = 1) {
  2. $q1 = mysqli_query($res, $this->db_link);
  3. if (!$q1) {
  4. $this->sql_error();
  5. if ($pass_no == 1) {
  6. if ($this->output_error == 1) {
  7. echo 'Attempting to reconnect to MySQL...' . "n";
  8. }
  9. $this->db_close();
  10. $this->db_connect();
  11. $this->query($res, 2);
  12. } else {
  13. if ($this->output_error == 1) {
  14. echo 'Reconnection failed; please check your MySQL server settings!' . "n";
  15. }
  16. }
  17. } else {
  18. return $q1;
  19. }
  20. }
  21.  
  22. global $db ;
  23.  
  24. $username = mysqli_real_escape_string($_POST['username_login']);
  25.  
  26. $q ="select * from ".DB_PREFIX."admins where username='".$username."' ".
  27. "and password='".md5( $_POST['password_login'])."'";
  28. // echo $q;
  29. $res =$db->query($q);
  30. if($db->num_rows($res)==1)
  31. {
  32.  
  33. return true ;
  34. }
  35.  
  36. return false ;
Add Comment
Please, Sign In to add comment