title: Get data from Mysql and convert into PHP array
body: <p>I hope to get some help on a problem that I suppose must be simple but I have been stuck for a while. </p>
  
  <p>I have a simple Mysql table with 3 fields ( id, customer, sales ) . All I need is to query this table and get an php array.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>$query = "SELECT * FROM mysqltable";    
  $result = $mysqli-&gt;query($query))
  </code></pre>
  
  <p>I need to write a code to loop and get an array in this format:</p>
  
  <pre><code>$row=array(0=&gt;"500,200",1=&gt;"500,300",2=&gt;"1000,600",3=&gt;"800,400",4=&gt;"200,500");
  </code></pre>
  
  <p>So I can end with </p>
  
  <pre><code>echo json_encode($row);
  </code></pre>
  
  <p>Would appreciate any help to solve this.</p>