title: How to return a specific variable from PHP to Android
body: <p>I have followed his popular tutorial to connect Android to MySQL:
  <a href="http://www.helloandroid.com/tutorials/connecting-mysql-database" rel="nofollow">http://www.helloandroid.com/tutorials/connecting-mysql-database</a></p>
  
  <p>It is great at encoding the data back in JSON and displaying rows of data.</p>
  
  <p>My question:  What id I want to return just a single value, a single varaible from PHP to Java?</p>
  
  <p>Here is my PHP:</p>
  
  <pre><code>$sql="SELECT AVG(rating) FROM ratings WHERE item_id = 1";
  $result=mysql_query($sql);
  $row=mysql_fetch_array($result);
  echo $row[0];
  </code></pre>
  
  <p>I want to send that last "echo" back to Android, on the guidelines of that tutorial above, how would I do this?</p>