title: Constructing a multi-argument MySQL Search Query
body: <p>I'm attempting to construct a search query in MySQL using multiple arguments, and I can't quite get it right.</p>
  
  <p>I'm receiving the search arguments from a form, and using them to dynamically build my query.</p>
  
  <p>Here is some background info:</p>
  
  <p>I have a MySQL database containing job information. There are four columns I want to search: </p>
  
  <ol>
  <li>Job Title</li>
  <li>Job Type</li>
  <li>Job Description</li>
  <li>Job Location</li>
  </ol>
  
  <p><strong>Job Title:</strong> This is a 1-5 word title of the Job post. It can be different based on the way it was input</p>
  
  <p><strong>Job Type:</strong>  This is a three letter code for the job type. </p>
  
  <p><strong>Job Description:</strong> This is a short description of the Job and duties</p>
  
  <p><strong>Location:</strong> This is a city or town</p>
  
  <p>The user will search using a search form. The search form consists of three parts. Two Text fields, "keywords", and "location"; and a dropdown box listing about 20 Job Types. This will allow them to choose between the three letter codes for the job listings.</p>
  
  <p>I would like to take the information from these three sections of the form and use them to search my database and return the most accurate records. I've tried several iterations of my query and it's either returning a lot of unrelated records, or not returning enough of the related ones. I've also been unable  to account for the user intentionally leaving portions of the form blank.</p>
  
  <p>My current query looks something like this:</p>
  
  <pre>
  select * FROM my_jobs_table
  WHERE category = 'User specified job type'
  OR job_title LIKE 'User specified Job keyword'
  OR job_description LIKE 'User specified Job keyword '
  OR location LIKE "% User Specified Job Location%"
  </pre>
  
  <p>This just isn't working for me.  Any Suggestions?</p>