我想从 url 获取数据。在这种情况下,我已经拥有完整的 php,数据已经转换为 json 并在 localhost (http://localhost/adchara1/index.php/?year=1) 中运行
这是php脚本
<?php
mysql_connect("localhost","root","");
mysql_select_db("test");
$q=mysql_query("SELECT * FROM people
WHERE
birthyear>'".$_REQUEST['year']."'");
while($e=mysql_fetch_assoc($q))
$output[]=$e;
print(json_encode($output));
mysql_close(); ?>
这是结果
[{"id":"1","name":"kongkea","sex":"1","birthyear":"1990"}, {"id":"2","name":"thida","sex":"0","birthyear":"2000"}]?>
我想使用按钮单击并在 textview 中显示此结果