} function getAllfromtableEmail($search){ $sql = 'SELECT *, DATE_FORMAT(userdate,"%d-%m-%Y") as userdate FROM users WHERE email LIKE :keyword'; $tb = $this->db->connection->prepare($sql); $tb->execute(array(':keyword'=>'%'.$search.'%')); $this->arrBest = $tb->fetchAll(PDO::FETCH_ASSOC); return $this->arrBest; } } if($search){ $getData = new mainpage_query(); if($methodSearch=='login'){ $arrSearch = $getData ->getAllfromtableLogin($search); } if($methodSearch=='email'){ $arrSearch = $getData ->getAllfromtableEmail($search); } if(count($arrSearch)==0){ $arrSearch['mistake'] = 'mistake'; }else{ } echo json_encode($arrSearch); }
} function getAllfromtableSername($search,$blocked){ $sql = 'SELECT *, DATE_FORMAT(userdate,"%d-%m-%Y") as userdate FROM users WHERE'.$blocked.' sername LIKE :keyword'; $tb = $this->db->connection->prepare($sql); $tb->execute(array(':keyword'=>'%'.$search.'%')); $this->arrBest = $tb->fetchAll(PDO::FETCH_ASSOC); return $this->arrBest; } } if($search){ $getData = new mainpage_query(); if($methodSearch=='login'){ $arrSearch = $getData ->getAllfromtableLogin($search,$blocked); } if($methodSearch=='email'){ $arrSearch = $getData ->getAllfromtableEmail($search,$blocked); } if($methodSearch=='name'){ $arrSearch = $getData ->getAllfromtableName($search,$blocked); } if($methodSearch=='sername'){ $arrSearch = $getData ->getAllfromtableSername($search,$blocked); } if(count($arrSearch)==0){