title: How to post multiple rows (or a LIST object) to PHP using JSON (Android)
body: <p>I am creating an android application in which I am using SQLite. I have one table in which I have 5 fields. There are many rows in that table and I want to send all those rows using JSON to my PHP code so I can receive the object and insert it in the MySQL database.</p>
  
  <p>What is the best way to do it. I am using LIST object but don't know how I can use POST it using JSON.</p>
  
  <p>Please guide!</p>
  
  <p>i am using this code</p>
  
  <pre><code>mCursor =db.rawQuery("SELECT * FROM customer", null);
  
             while (mCursor.moveToNext()) {
                  // In one loop, cursor read one undergraduate all details
                  // Assume, we also need to see all the details of each and every undergraduate
                  // What we have to do is in each loop, read all the values, pass them to the POJO class
                  //and create a ArrayList of undergraduates
                 customer = new Customer();   
                 customer.CustomerName = mCursor.getString(0).toString();
                 customer.Phone = mCursor.getString(1).toString();
                 customer.BrandName = mCursor.getString(2).toString();
                 customer.City = mCursor.getString(3).toString();
                 customer.FamilyMembers = mCursor.getString(4).toString();
  
                 customerList.add(customer);                 
  
              }
  for (int i = 0; i &lt; customerList.size(); i++) 
                  {
                      JSONObject row = new JSONObject();
                      row.put("Customer", customerList.get(i));                        
                      json.put(row);
                  }
  </code></pre>
  
  <p>Don't know how to post it to PHP code.</p>