title: How to display results from search below the form
body: <p>i would like to ask if someone could help me with a search query and displaying of the results.</p>
  
  <p>Here is the code...</p>
  
  <pre><code>&lt;?php
  // Change the fields below as per the requirements
  $db_host="localhost";
  $db_username="dasi";
  $db_password="**************";
  $db_name="dasi";
  $db_tb_name="test";
  $db_tb_atr_price="price_vat";
  $db_tb_atr_cur="currency";
  
  //Now we are going to write a script that will do search task
  // leave the below fields as it is except while loop, which will display results on screen
  
  mysql_connect("$db_host","$db_username","$db_password");
  mysql_select_db("$db_name");
  
  $query=mysql_real_escape_string($_GET['query']);
  
  $query_for_result=mysql_query("SELECT * FROM $db_tb_name WHERE code like '%".$query."%'");
  
  echo "&lt;h2&gt;Search Results&lt;/h2&gt;&lt;ol&gt;";
  while($data_fetch=mysql_fetch_array($query_for_result))
  {
      echo "&lt;table border=1&gt;";
      echo "&lt;tr&gt;&lt;td&gt;" . $data_fetch['code'] . "&lt;/td&gt;&lt;td&gt;" . $data_fetch['price_vat'] . "&lt;/td&gt;&lt;td&gt;" .  $data_fetch['currency'] . "&lt;/td&gt;&lt;/tr&gt;";
      echo "&lt;/table&gt;";
  }
  echo "&lt;/ol&gt;";
  
  
  
  mysql_close();
  ?&gt;
  </code></pre>
  
  <p>In content i added the form ...</p>
  
  <pre><code>&lt;form action="search.php" method="post"&gt;
  &lt;label&gt;Search For: &lt;/label&gt;&lt;input name="query" type="text" /&gt;&lt;input name="submit" type="submit" value="Start Search" /&gt;
  &amp;nbsp;&lt;/form&gt;
  </code></pre>
  
  <p>So ... all is working normaly.. i am getting the results, everything is fine. Problem is: 
  i want to have results displayed below the form itself, not in a new page.</p>
  
  <p>If anyone could help me that would be great. Thank you in advance</p>
  
  <p>P.S.</p>
  
  <p>Well i have no idea how it works actualy but was thinking, isnt there a way where the result can be added into empty div below the form or something like this? I tryed the options above but it dosnt helped.</p>