我在理解下面的代码行时遇到了一些问题。究竟是什么做的,它是如何帮助我查询在AndroidAndroid查询外部MySQL数据库

$q=mysql_query("SELECT * FROM people WHERE birthyear>'".$_REQUEST['year']."'");

while($e=mysql_fetch_assoc($q))

$output[]=$e;

print(json_encode($output));

我知道初始部分的数据库就意味着选择表的人那里birthyear每个记录......

不过,我以后困惑了。我从Android使用http调用这个php函数post

ArrayList nameValuePairs = new ArrayList();

nameValuePairs.add(new BasicNameValuePair("year","1980"));

HttpClient httpclient = new DefaultHttpClient();

HttpPost httppost = new HttpPost("http://10.0.2.2/retrieve.php");

httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

HttpResponse response = httpclient.execute(httppost);

HttpEntity entity = response.getEntity();

is = entity.getContent();

输入流在哪里。有人可以帮我吗?

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐