title: Return a multidimensional array from MySQL result php
body: <p>I have a PHP function that extract dat of an invoice from DB.</p>
  
  <p>The invoice may have more then one line (one product).  </p>
  
  <pre><code>function getInvoiceLines($id)
  {
     $res = mysql_query("select * from invoice_lines where id = $id ");
     while ($row = mysql_fetch_array($res))
     {
        $res_retun['ref']=$row['ref'];
        $res_retun['label']=$row['label'];
        $res_retun['price']=$row['label'];
        $res_retun['qty']=$row['qty'];
     }
  
  return $res_retun ;
  
  }
  </code></pre>
  
  <p>I found this link <a href="https://stackoverflow.com/questions/8289059/create-a-multidimensional-array-with-php-and-mysql?answertab=active#tab-top">Create a Multidimensional Array with PHP and MySQL</a> and I made this code using that concept. </p>
  
  <p>Now, how can I move something like a cursor to the next line and add more lines if there's more in MySQL result?? </p>
  
  <p>If it's possible, how can I do to show data in HTML with for ??</p>