title: how to retrieve the table values from database using mysql php
body: <p>I have concatenated three tables to one table that is edit all. Now i'm going to retrieve the all the 4 values that starts with the particular letter, But is displaying all values with starts with different letter.<br>
               
  
  <pre><code>    include "config.php";
      $term = strip_tags(substr($_POST['searchit'],0,100));
      $term = mysql_real_escape_string($term); 
      if($term=="")
      echo "Enter Something to search";
      else{
      $query = mysql_query("select distinct videoname,category,name,email from edit_all
          where videoname like '$term%' or category like '$term%' or name like '$term%' or email like '$term%'limit 1") or die(mysql_error());
  
      $string= '';
  
      if (mysql_num_rows($query))
      {
      while($row = mysql_fetch_assoc($query)){
      $string .= "&lt;b&gt;&lt;a href='#'&gt;".$row['videoname']."&lt;/a&gt;&lt;/b&gt; -&lt;br&gt; ";
      $string .= $row['category']."-&lt;br&gt;";
      $string .= $row['name']."-&lt;br&gt;";
      $string .= $row['email']."-&lt;br&gt;";
      $string .= "\n";
      }
      }
      else{
      $string = "No matches found!";
      }
      echo $string;
      }
      ?&gt;
  </code></pre>