-1

I have a search box with the following inputs

Keywords [seperated by comma]
Location [Seperated by comma]
Salary min and max
experience
category of job
freshness of job post

Note:i have made it not mandatory to fill any of these boxes.

How do i generate search results based on a search form like this? what should be the mysql query that satisfies all the conditions? Any help wud be appreciated.

Aurelio De Rosa
  • 21,856
  • 8
  • 48
  • 71
Sree Ram
  • 3
  • 1
  • 2
    Explaining the structure of your db table and the form deeper would make it easier to help you – Daniel Oct 09 '11 at 14:24
  • What have you tried? Anyway, it is clear that you have to do a set of AND in your sql. – Aurelio De Rosa Oct 09 '11 at 14:29
  • Guessing that you have some basic knowledge the only thing worth to mention is that since keywords and location are more than one word, put a loop there to built the required sql condition. Then concatenate it to the rest of the sql that is trivial. There is an example of sql condition formating here, you can see how it is done: http://stackoverflow.com/questions/7674201/ignore-duplicate-results-from-foreach-loop-iterating-through-mysql-query/7696525#7696525 – Melsi Oct 09 '11 at 14:30
  • the db contains the following fields along with a few others...`job_title` `job_code` `location` `keywords` `experience_min` `experience_max` `category_select` `job_description` – Sree Ram Oct 09 '11 at 14:30

1 Answers1

0

Look up writing your own search engine. I have written many, and you'll need:

strtolower(); substr(); explode(); (for keywords)

Adam Fowler
  • 1,750
  • 1
  • 17
  • 18