Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function query($res, $pass_no = 1) {
- $q1 = mysqli_query($res, $this->db_link);
- if (!$q1) {
- $this->sql_error();
- if ($pass_no == 1) {
- if ($this->output_error == 1) {
- echo 'Attempting to reconnect to MySQL...' . "n";
- }
- $this->db_close();
- $this->db_connect();
- $this->query($res, 2);
- } else {
- if ($this->output_error == 1) {
- echo 'Reconnection failed; please check your MySQL server settings!' . "n";
- }
- }
- } else {
- return $q1;
- }
- }
- global $db ;
- $username = mysqli_real_escape_string($_POST['username_login']);
- $q ="select * from ".DB_PREFIX."admins where username='".$username."' ".
- "and password='".md5( $_POST['password_login'])."'";
- // echo $q;
- $res =$db->query($q);
- if($db->num_rows($res)==1)
- {
- return true ;
- }
- return false ;
Add Comment
Please, Sign In to add comment