mysql_connect("localhost","root");
mysql_select_db("dbtuts");
$res=mysql_query("SELECT c.* , p.* FROM tbl_categories c,tbl_products p WHERE c.cat_id=p.cat_id");
while($row=mysql_fetch_array($res))
{
?>
}
?>
Ayrıntılar;
http://cleartuts.blogspot.com/2014/12/fetch-data-from-multiple-tables-in-php.html
İşinizi görür umarım.