title: Nested While Loop PHP
body: <p>I need help with loop through MySQL data. </p>
  
  <p>I have stock table as below. </p>
  
  <p><a href="https://i.stack.imgur.com/5QuJr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5QuJr.png" alt="enter image description here"></a></p>
  
  <p>What I would like to do is do an select statement which would get all the rows from stock table, if it has "numberassigned_vnr" more than 1, loop through that and show that as separate row. </p>
  
  <p>I need help with writing select statement which would loop through the table and show result and if has "numberassigned_vnr" more than one, loop through and print the result to that number of times.</p>
  
  <p>So I should see something like this. </p>
  
  <pre><code>1   27  300  Black
  1   27  300  Black
  1   27  300  Black
  7   29  315  Black
  7   29  315  Black
  2   28  315  Black
  3   29  315  Black
  ......
  .....
  </code></pre>
  
  <p>Thank you in advance. </p>