Hi,
i am not sure how best to explain this, so apologies in advance if i sound stupid. My query below never seems to pick up the 'OR' conditions correctly. it works ok if the first attribute is set (Jobtitle) or both(jobtitle and jobtype) or all three (jobtitle, jobtype and Location_1), but returns all results (not matched) if second attribute is set on its own (jobtype) or third attribute on its own (Location_1). can somebody plz help?
Code:$query="SELECT consultant.idConsultant AS idCon, concat(consultant.FName, consultant.SName) AS Name, consultant.DateCreated, consultant.EmailMe, consultant.EmailCVIn, consultant.EmailDaxtra, adverts.idAdvert AS IDAdvert, adverts.idBondAdapt, adverts.DateCreated, adverts.JobTitle, adverts.JobType, adverts.StartDate, adverts.JobDescription, adverts.SalaryFrom, adverts.SalaryTo, adverts.SalaryPer, adverts.SalaryBenefits, adverts.Location_1, adverts.Location_2, adverts.idConsultant, advertstatus.idAdvertStatus, advertstatus.AdvertStatus, advertstatus.AdvertRefresh, advertstatus.DateRefreshed AS AdStatusDateRefreshed, advertstatus.idAdvert AS AdvertStatusID FROM consultant, adverts, advertstatus WHERE advertstatus.AdvertStatus='Live' AND( JobTitle LIKE '%".$Jobtitle_Escape."' OR JobType LIKE '%".$Jobtype_Escape."' OR Location_1 LIKE '%".$Locations_Escape."' ) AND consultant.idConsultant=adverts.idConsultant AND adverts.idAdvert=advertstatus.idAdvert ORDER BY (AdStatusDateRefreshed) DESC LIMIT $set_limit, $limit";











Bookmarks