Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.94 KB | None | 0 0
  1.         $sql = "SELECT title,created,work_company,
  2.             IF(count(city_id) > 1,'Multiple cities',city.city_name) as city,
  3.          IF(job_type =1,'Full time','Part time') as Job_type
  4.                     FROM work_history
  5.                   JOIN content ON content.owned_user = work_history.user_id
  6.                   JOIN job ON content.content_id = job.content_id
  7.          join job_city ON content.content_id = job_city.content_id
  8.          JOIN city ON city.id = job_city.city_id
  9.                     WHERE content.type =6 AND work_history. current_working = 1";
  10.           if(!empty($filters['cataegory'])){
  11.                        $sql .=" AND job.category = ".$filters['cataegory'].""; 
  12.                     }
  13.                     if(!empty($filters['type'])){
  14.                        $sql .=" AND job.job_type = ".$filters['type']."";  
  15.                     }
  16.                     if(!empty($filters['city'])){
  17.                        $sql .=" AND city.id = ".$filters['city']."";   
  18.                     }
  19.                     if(!empty($filters['min_salary'])){
  20.                        $sql .=" AND job.min_sallary >= ".$filters['min_salary']."";
  21.                     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement