title: PHP/MYSQL advanced search script. How?
body: <p>I need some guidance to make an advanced search script for a website I'm working on.</p>
  
  <p>I already know how to search the database for simple queries. The problem I'm encountering right now is how to search, when using multiple select boxes. For example:</p>
  
  <p><img src="https://i.stack.imgur.com/XYzzh.jpg" alt="enter image description here"></p>
  
  <p>This is just a simple form with different search options. The question is:</p>
  
  <p>The visitor can choose to search on a country or city, both or even with all three options.</p>
  
  <p>How do I catch that in the PHP script? Do I have to check if for example a city has been chosen, and fire a query based on that? But if I do that I would have to make different queries based on each select option. </p>
  
  <p>In pseudo-code it would be something like this: (I imagine)</p>
  
  <p>if country and city and something else is not null, launch a query to search in all three tables in the database.</p>
  
  <p><strong>But what to do when just the country has been chosen? Or just the city?</strong></p>
  
  <p>Is there a simple way to accomplish this?</p>
  
  <p>Thanks in advance.</p>