title: org.json.JSONException: No value for item
body: <p>I get a <code>No value for {"username":"sara"}{"username":"john"}</code> <code>JSONException</code> when I attempt to view data from MySql database using android app.</p>
  
  <pre><code>  08-20 04:26:39.396: W/System.err(4732): org.json.JSONException: No value for {"username":"sara"}{"username":"john"}
    08-20 04:26:39.497: W/System.err(4732):   at org.json.JSONObject.get(JSONObject.java:354)
    08-20 04:26:39.497: W/System.err(4732):   at org.json.JSONObject.getJSONArray(JSONObject.java:544)
    08-20 04:26:39.517: W/System.err(4732):   at com.example.phpapp.ViewData$MyTask.doInBackground(ViewData.java:69)
    08-20 04:26:39.577: W/System.err(4732):   at com.example.phpapp.ViewData$MyTask.doInBackground(ViewData.java:1)
    08-20 04:26:39.606: W/System.err(4732):   at android.os.AsyncTask$2.call(AsyncTask.java:287)
    08-20 04:26:39.606: W/System.err(4732):   at java.util.concurrent.FutureTask.run(FutureTask.java:234)
    08-20 04:26:39.631: W/System.err(4732):   at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
    08-20 04:26:39.636: W/System.err(4732):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
    08-20 04:26:39.636: W/System.err(4732):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
    08-20 04:26:39.636: W/System.err(4732):   at java.lang.Thread.run(Thread.java:856)
  </code></pre>
  
  <h2>PHP code</h2>
  
  <pre><code>$con = mysql_connect($dbhost, $dbuser, $dbpass) or die("can't connect");
  $db = mysql_select_db($dbname) or die("no such db name");
  $query = "select username from users";
  $result = mysql_query($query);
  while($row=  mysql_fetch_array($result)){
      echo json_encode($row);
  }
  </code></pre>
  
  <h2>jsonArray</h2>
  
  <pre><code>{"username":"sara"}{"username":"john"}
  </code></pre>
  
  <h2>Android Code</h2>
  
  <pre><code>HttpResponse response = client.execute(post);
  HttpEntity entity = response.getEntity();
  InputStream is = entity.getContent();
  BufferedReader br = new BufferedReader(new InputStreamReader(is));
  
  String str = "";
  while((str = br.readLine()) != null){
      s.append(str+"\n");
      mystr = s.toString();
  }   
  
  JSONObject object = new JSONObject(mystr);
  JSONArray Jarray = object.getJSONArray(mystr);
  for (int i = 0; i &lt; Jarray.length(); i++) {
      JSONObject Jasonobject = Jarray.getJSONObject(i);
      st = Jasonobject.getString("username");
      alist.add(str);
  }
  </code></pre>
  
  <p>How to Solve this? Thanks</p>