title: how i can retrieving result from mysql in array?
body: <p>I want to get results from the database as an array. I have a table "commande" where I have stock. I want to get stock as an array. Something like this: <code>array[0],array[],array[2]</code>
  This is  the structure of my table commande <code>(idfichecmd    idproduit   idclt   qte     datecmd)</code></p>
  
  <p>This is my code:</p>
  
  <pre><code>String response = null;
  String res = "";
  //the year data to send
  ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
  nameValuePairs.add(new BasicNameValuePair("",));   
  try {
      Log.i("","&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;TRY");      
      response = CustomHttpClient.executeHttpPost("http://0.0.0.0/GetCmdDetails.php",nameValuePairs); 
      res=response.toString();
      // res = res.trim();
      //res= res.replaceAll("\\s+","");
      //error.setText(res);
  
  } catch (Exception e) {
      Log.i("","&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;Catch");
  }
  
  //parse json data
  try{
      JSONArray jArray = new JSONArray(res);
      //-----------------------------------------
      //nom= new String[jArray.length()];
      //prenom= new String[jArray.length()];
      //----------------------------------------
      for (int i=0;i&lt;jArray.length();i++) {
          JSONObject json_data = jArray.getJSONObject(i)
  </code></pre>