title: Database column based record filtering not working using auto-complete search PHP
body: <p>I have integrated auto-complete search in my site where user enter keyword and view the records based on it.</p>
  
  <p>Suppose, if I write zip code it only filter data from zip field. Next, if user types address like 121 North West, so script automatically pick records matches 121 North West. Moreover, same for street, if user type street name like cedar lane, it then fetches records from database field street only.</p>
  
  <p>I am having problem that it searches the records from all fields and so I am unable to get proper listing from database.</p>
  
  <p>Referense site I am following is <a href="http://www.trulia.com/" rel="nofollow">http://www.trulia.com</a> here this is working as expected. I want the same on my site and it works but not like I expects.</p>
  
  <p>My PHP Code:</p>
  
  <pre><code>&lt;?php
  $searchKeyword  = $_REQUEST['keyword'];
  
  $searchQ    =   "SELECT zip, ste, st, st_num, town, addr FROM tbl_property WHERE (zip = '$searchKeyword' OR ste like '%$searchKeyword%' OR town like '%$searchKeyword%' OR addr like '%$searchKeyword%') GROUP BY zip LIMIT 0,5";
  $queryRec   = mysql_query($searchQ);
  $recSet     = mysql_num_rows($queryRec);
  echo "&lt;div id='fetchRecs'&gt;&lt;ul&gt;";
  if($recSet&gt;0){
      while($row = mysql_fetch_array($queryRec)) { 
          echo '&lt;li&gt;'.$row['addr'].', '.$row['town'].', '.$row['ste'].', '.$row['zip'];?&gt;&lt;/li&gt;
      &lt;?php
              }
          }else{
      echo "&lt;li&gt;No Records Found&lt;/li&gt;";       
      }
  echo "&lt;/ul&gt;&lt;/div&gt;";
  </code></pre>
  
  <p>I simply want if user writes 123, list shows like 1234,1245, and same like listing that show only zip codes from zip column. </p>
  
  <p>Same, If user write 123 cedar it picks listing similar to 123 cedar only means it will come from street column.</p>
  
  <p>P.S: I am having only one text field in which I type keyword like: <a href="http://www.trulia.com" rel="nofollow">http://www.trulia.com</a></p>
  
  <p><strong>P.S: My question is still not resolved, please share if anybody have any useful information. May be it will work for some other as well.</strong></p>