title: PHP MySQL - Fetch same id on two separate table in database
body: <p>i am trying to fetch this <code>customer_id</code> on my table <code>tbl_customers</code> and when I get that id i also want to fetch the values of <code>customer_id</code> on my second table <code>tbl_stocks</code> so that i can bind the data which <code>tbl_customers</code> has.</p>
  
  <p><strong><em>1st - here is my table <code>tbl_customers</code> structure please take a look.</em></strong></p>
  
  <p><a href="https://i.stack.imgur.com/A7fvX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A7fvX.png" alt="tbl1"></a></p>
  
  <p><strong><em>2nd - here is my table <code>tbl_stocks</code> structure also, please take a look.</em></strong>
  <a href="https://i.stack.imgur.com/dtOKh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dtOKh.png" alt="enter image description here"></a></p>
  
  <p>as you can see what i want is the number of <code>cutomer_id</code> on the <code>tbl_customers</code> .<strong>THAT</strong> id is bind and will <strong>fetch all the same id and values of row</strong> in <code>tbl_stocks</code> which is <code>customer_id</code> also, so for this type of query how can i make the sql query statement this problem? so far i have this sql statement but it is not getting the data.</p>
  
  <pre><code> //PSEUDO CODE ONLY IM NOT FAMILIAR WITH THE SYNTAX OF THIS PROBLEM
  
  $sql = SELECT `tbl_customers` FROM `customer_id` = 1 AND SELECT `tbl_stocks` FROM `customer_id` = 1;
  </code></pre>
  
  <p>and so if it is working the final <strong><em>OUTPUT</em></strong> which i will fetch will be like this for example </p>
  
  <p><a href="https://i.stack.imgur.com/yRDrX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yRDrX.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>P.S - I dont need to display it on a textbox or in any form inputs i just need to fetch it using sql query so that i know that program is getting the value of the table thanks !</p>
  </blockquote>