title: Select id from one table and its value from another table to search
body: <p>I have two tables named <code>company</code> and <code>customers</code>. </p>
  
  <p>In <code>company</code> table there are 3 fields <code>ID</code>, <code>Company</code>, and <code>Type</code> as:</p>
  
  <pre><code>ID    Company    Type
  1     ABC        Running
  
  2     XYZ        Current
  </code></pre>
  
  <p>Now again in <code>customers</code> table I submitted the value of company and customers, but here the value of company is submitted as an <code>ID</code> as:</p>
  
  <pre><code>Company     Customer Name
  1              monty
  
  2             sandeep
  </code></pre>
  
  <p>now I want to search the company name in customer table but when i put company name in search box its showing nothing because the value of company name is in ID form in customer tabe.how can i achieve it.</p>
  
  <p>Here is my query for search:</p>
  
  <pre><code>$sql = "Select * from customers where name like '%$term%' or location like '%$term%' or company like '%$term%'";
  </code></pre>