title: Fetch data from two table in a php file
body: <p>i have online store and i want to make an api for it
  i have a three tables in MySql database i Should use to fetch the product details
  <code>file_path</code> for the product image url
  <code>invetory_details </code> for price
  <code>tbl_product </code> for the product details like (name , description, digital or  physical...etc)
  i didn't know how to fetch data from more than one table  please help me with this.
  this is my code i was able to fetch data from one table</p>
  <pre><code>  define('DB_HOST','localhost');
    define('DB_USER','admin');
    define('DB_PASS','123456');
    define('DB_NAME','testname');
    
    $conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
    if (mysqli_connect_errno()){
        die('error'.mysqli_connect_error());
    }
    $stmt = $conn-&gt;prepare( &quot;SELECT id, upc_code, category_id, sub_category_id, sub_subcategory_id, name, description, brand_id , digital, license_key_code, active , added_by_id, sort_order, rating, added_at, updated_at FROM tbl_product;&quot;);
    $stmt-&gt;execute();
    $stmt-&gt;bind_result($id, $upc_code, $category_id, $sub_category_id, $sub_subcategory_id, $name, $description, $brand_id, $digital, $license_key_code, $active, $added_by_id, $sort_order, $rating, $added_at, $updated_at);
    $product= array();
    
    while($stmt-&gt;fetch()){
        $temp=array();
        $temp['id']=$id;
        $temp['upc_code']=$upc_code;
        $temp['category_id']=$category_id;
        $temp['sub_category_id']=$sub_category_id;
        $temp['sub_subcategory_id']=$sub_subcategory_id;
        $temp['name']=$name;
        $temp['digital']=$digital;
        $temp['active']=$active;
        $temp['added_by_id']=$added_by_id;
        $temp['sort_order']=$sort_order;
        $temp['rating']=$rating;
        $temp['added_at']=$added_at;
        $temp['updated_at']=$updated_at;
        
        array_push($product, $temp);
    }
    echo json_encode($product);
  </code></pre>