title: multiple keyword search using php mysql result related record
body: <pre><code>ID    CODE      STATE    CITY            AREA
  1   SBIN0000952 ORISSA  JAIPUR          TOWN
  2   SBIN0000953 ORISSA  KURAPUT         VILLAGE
  3   SBIN0000954 DELHI   DELHI           TOWN
  4   SBIN0000955 DELHI   NEW DELHI       VILLAGE
  5   SBIN0000956 GOA     SOUTH GOA       VILLAGE
  6   SBIN0000957 GOA     PANAJI          TOWN
  7   SBIN0000958 KERLA   CHOCHIN         TOWN
  8   SBIN0000959 KERLA   TRIVANDRAM      VILLAGE
  9   SBIN0000960 ANDHRA  VIZAG           TOWN
  10  SBIN0000961 ANDHRA  HYDERABAD       VILLAGE
  </code></pre>
  
  <p>above is my table and i want search a multiple keyword for example</p>
  
  <p>kerla town then it should display the record</p>
  
  <pre><code>7   SBIN0000958 KERLA   CHOCHIN    TOWN
  </code></pre>
  
  <p>below my present code in php</p>
  
  <pre><code>include('dbConnect.inc.php');
  
  //collect
  if(!isset($_POST['search'])){
      header("Location:index.php");
  
  } 
      $searchq = mysql_real_escape_string( $_POST['search']);
      $search_sql = "SELECT * FROM `bankifscin` WHERE STATE LIKE '%$searchq%' OR CITY LIKE '%$searchq%' OR CODE LIKE '%$searchq%' ";
      $search_query = mysql_query($search_sql) or die(mysql_error());
      if(mysql_num_rows($search_query)!=0){
      $search_rs = mysql_fetch_assoc($search_query);
      }
  </code></pre>
  
  <p>to print</p>
  
  <pre><code>&lt;?php if(mysql_num_rows($search_query)!=0){
      do{ ?&gt;
  
      &lt;?php 
  
      $bank = $search_rs['BANK'];
      $ifsc = $search_rs['IFSC'];
      $branch= $search_rs['BRANCH'];
      $micr = $search_rs['MICR_CODE'];
      $address = $search_rs['ADDRESS'];
      $contact = $search_rs['CONTACT'];
      $city = $search_rs['CITY'];
      $district = $search_rs['DISTRICT'];
      $state = $search_rs['STATE'];
           ?&gt;
           &lt;table width="100%" border="2" bordercolor="#000" class="bdrcolor"&gt;
  
  
      &lt;tbody&gt;     
    &lt;tr&gt;
      &lt;td width="15%"&gt;&lt;?=$bank?&gt;&lt;/td&gt; 
         &lt;td width="15%"&gt;&lt;?=$branch?&gt;&lt;/td&gt;
         &lt;td width="15%"&gt;&lt;b&gt;IFSC:&lt;/b&gt;&lt;?=$ifsc?&gt; &lt;br /&gt;&lt;b&gt;MICR:&lt;/b&gt;&lt;?=$micr?&gt;&lt;/td&gt;
         &lt;td width="20%"&gt;&lt;?=$address?&gt;&lt;br /&gt; &lt;b&gt;City :&lt;/b&gt;&lt;?=$city?&gt; &lt;br /&gt; &lt;b&gt;District :&lt;/b&gt;&lt;?=$district?&gt; &lt;br /&gt; &lt;b&gt;State:&lt;/b&gt; &lt;?=$state?&gt;&lt;/td&gt; 
         &lt;td width="10%"&gt;&lt;?=$contact?&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;br /&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  
  
  
      &lt;?php   }while ($search_rs = mysql_fetch_assoc($search_query)); 
  
  }else{
          echo "No Results";
  
          }
  
  
      ?&gt;
  </code></pre>
  
  <p>its only giving the result of one keyword or no result</p>