title: How to show all results if search is empty
body: <p>I have the code below where I am trying to search by Country. On the home page there is a dropdown box to select the Country from. My problem is that it shows the results for the selected Country but if nothing is selected then there are no results.</p>
  
  <p>I want it to show <strong>ALL</strong> Country results if there is no selection. </p>
  
  <p>With this code in the mysql search if country_select was empty then there are zero results:</p>
  
  <pre><code>and bam.country='".mysql_real_escape_string(trim($_POST['country_select']))."'
  </code></pre>
  
  <p>Here is the full code:</p>
  
  <pre><code>$searchsql = "SELECT pp_id, appmt_id, price, max( stay_from )
                          FROM (
                          SELECT bp.pp_id, bam.appmt_id, bam.appmt_name, bp.price, bp.stay_from
                          FROM bsi_apartment_master AS bam, bsi_appmt_features AS baf, bsi_priceplan AS bp
                          WHERE bam.status=true and baf.appmt_id = bam.appmt_id".$addquery." AND baf.bedroom &gt;=".$this-&gt;bedroom." AND baf.bathroom &gt;=".$this-&gt;bathroom."
                          and bam.country='".mysql_real_escape_string(trim($_POST['country_select']))."'
                          AND bam.appmt_id NOT IN (SELECT appmt_id FROM bsi_bookings WHERE is_deleted = FALSE AND (( '".$this-&gt;mysqlCheckInDate."'
                          BETWEEN checkin_date AND checkin_date AND DATE_SUB(checkout_date, INTERVAL 1 DAY) )
                          OR ( DATE_SUB('".$this-&gt;mysqlCheckOutDate."', INTERVAL 1 DAY) BETWEEN checkin_date AND checkin_date AND DATE_SUB(checkout_date, INTERVAL 1 DAY) )
                          OR ( checkin_date BETWEEN '".$this-&gt;mysqlCheckInDate."' AND DATE_SUB('".$this-&gt;mysqlCheckOutDate."', INTERVAL 1 DAY) )
                          OR ( checkin_date AND DATE_SUB(checkout_date, INTERVAL 1 DAY) BETWEEN '".$this-&gt;mysqlCheckInDate."' AND DATE_SUB('".$this-&gt;mysqlCheckOutDate."', INTERVAL 1 DAY) )))
                          AND bam.appmt_id = bp.appmt_id
                          AND if( ( ".$staycount." NOT BETWEEN bp.stay_from AND bp.stay_to ) = true, 
                          ( ".$staycount." NOT BETWEEN bp.stay_from AND bp.stay_to ) AND bp.default_pp !=0, 
                          ( ".$staycount." BETWEEN bp.stay_from AND bp.stay_to ) )
                          order by bp.stay_from desc
                          ) AS t1
                          GROUP BY appmt_id
                          order by price ".$this-&gt;sorting;
  </code></pre>