title: How to fetch a data from a different table in the databse depending on the outcome of another fetch
body: <p>I'm not sure how to word the question but what I'm trying to do is have a jquery autocomplete show some data, now it's already doing so but there's a slight problem.
  The way this website is set up is it has products, and suppliers, the suppliers have their own table and are all assigned an id, and the products have a "supplier" row that has a number.
  Right now when searching for a product I'm doing this to output the search results:</p>
  
  <pre><code>$get_prods = mysql_query("SELECT * FROM `table`".$showall);
                  $get_brand = mysql_query("SELECT * FROM `table2`");
                  $js = "";
                  while($prods = mysql_fetch_array($get_prods)){
                      $prodbrand = mysql_fetch_array($get_brand);
                      $js .= "'".addslashes($prodbrand['supplier']).";;".addslashes($prods['sku']).";; ". addslashes($prods['name'])." (".indexStock($prods['id'])." on stock)',";
  </code></pre>
  
  <p>but when you search for a product instead of showing the supplier name it shows the suppliers id number, is there a way to have it fetch the actual supplier name instead?</p>