title: php/sql with json output
body: <p>I would like to create a json from my database's datas and the json output is like this:</p>
  
  <pre><code>`[{"id":"1","0":"1","nom":"test","1":"test","prenom":"john","2":"john","societe":"","3":"","mail":"johntest@gmail.com","4":"johntest@gmail.com","type":"creatif","5":"creatif","url":"johntest","6":"johntest"}]`
  </code></pre>
  
  <p>My php code to doing so is : </p>
  
  <pre><code>$stock = array();
  $sql = $bdd-&gt;prepare("SELECT * FROM user");
  if ($sql-&gt;execute())
  {
      while ($row = $sql-&gt;fetch())
      $stock[] = $row;
  }
  print json_encode($stock);
  </code></pre>
  
  <p>My problem here is that everything is doubled, I have a first data with the good property like <code>"nom":"test"</code> and then I have a thing out of nowhere <code>"1":"test"</code>.</p>
  
  <p>How can I get rid of this second thing?</p>
  
  <p>Thank you for your help</p>