title: android view php result json on android app
body: <p>i try to change in my java code a result returned  from json php code.</p>
  
  <p>There is my php file : </p>
  
  <pre class="lang-php prettyprint-override"><code> &lt;?php
   mysql_connect("localhost","user","pass");
   mysql_select_db("database");
   $sql=mysql_query("SELECT * FROM ads WHERE id='1'");
   while($row=mysql_fetch_assoc($sql))
   $output=$row['number'];
   print(json_encode($output));
   mysql_close();
   ?&gt;
  </code></pre>
  
  <p>This code return : 123456</p>
  
  <p>Now in my AppMainActivity; i want to display the output here > "DISPLAY OUTPUT HERE" : </p>
  
  <pre class="lang-java prettyprint-override"><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      configMenu(true);
      setContentView(R.layout.activity_main);
      interstitial = new AdController(act, "DISPLAY OUTPUT HERE");
      interstitial.loadAd();
  </code></pre>
  
  <p>I have try to add the line : </p>
  
  <pre class="lang-java prettyprint-override"><code>JSONObject data = new JSONObject(json.getString("output"));
  </code></pre>
  
  <p>but i don't know now what i must to put ..</p>
  
  <p>I have searching, find many codes, but none comes close to what I want</p>
  
  <p>Thanks a lot</p>