0
我有一個PHP文件,返回一個單一的數字(即360)。我怎樣才能讓這個數字出現在我的android textview中。我可以用數組看起來像這樣做:如何獲取使用JSON解析到Android TextView的mysql行數?
{"success":1,"message":"Post Available!","posts":[{"name":"John Smith","id":"1"}, ...]}
,但我怎麼能只用一個單一的數字做。
這裏是PHP:
<?php
include('connect.php');
$gettotal=mysql_query("SELECT * FROM records");
totalrecords=mysql_num_rows($gettotal);
echo json_encode($totalrecords);
?>
感謝。
我得到了要輸出的數字,但我如何需要Java代碼的幫助才能將其輸入到TextView中。 – JSON