安卓端代码: public void inserthttp(String jd,String wd,Drawable er)
{
/*声明网址字符串*/
        String uriAPI = "http://59.37.191.158:8090/guestbook.php";
        /*建立HTTP Post联机*/
        HttpPost httpRequest = new HttpPost(uriAPI); 
        /*
         * Post运作传送变量必须用NameValuePair[]数组储存
        */
        List <NameValuePair> params = new ArrayList <NameValuePair>(); 
        params.add(new BasicNameValuePair("j", jd)); 
        params.add(new BasicNameValuePair("w", wd)); 
        try 
        { 
          /*发出HTTP request*/
          httpRequest.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8)); 
          /*取得HTTP response*/
          HttpResponse httpResponse = new DefaultHttpClient().execute(httpRequest); 
          /*若状态码为200 ok*/
          if(httpResponse.getStatusLine().getStatusCode() == 200)  
          { 
            /*取出响应字符串*/
            String strResult = EntityUtils.toString(httpResponse.getEntity(), "GBK");
            jarry = new JSONArray(strResult);
            for(int i=0;i<jarry.length();i++){
             try {
     mMapView.getOverlays().add(new OverItemT(er, this,jarry.getJSONObject(i).getString("j"),jarry.getJSONObject(i).getString("w"),jarry.getJSONObject(i).getString("gjxname"),jarry.getJSONObject(i).getString("Content")));
     } catch (JSONException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
     }
           } 
          } 
          else 
          { 
          } 
        } 
        catch (ClientProtocolException e) 
        {  
          e.printStackTrace(); 
        } 
        catch (IOException e) 
        {  
          e.printStackTrace(); 
        } 
        catch (Exception e) 
        {  
          e.printStackTrace();  
        }  
}在服务器端用php接收参数并查询和插入,但是只执行了查询没执行插入[<?php
$j=$_POST['j'];
$jMax=$j+0.002;
$jMin=$j-0.002;
$w=$_POST['w'];
$wMax=$w+0.002;
$wMin=$w-0.002;
include_once("db/conn.php");
$query="SELECT * FROM gjx where j<".$jMax." and j>".$jMin." and w<".$wMax." and w>".$wMin." order by id asc";
//$query="SELECT * FROM gjx order by id asc";
$result=mysql_query($query);
$query1="insert into guestbook (gjxname,Content) VALUES('".$j."','".$j."')";
mysql_query($query1);
while($r=mysql_fetch_array($result)){
?>
{"gjxname":"<?=$r["gjxname"]?>","j":"<?=$r["j"]?>","w":"<?=$r["w"]?>","Content":"<?=$r["Content"]?>"},
<?php
}
?>]不知道什么原因啊,把$query1="insert into guestbook (gjxname,Content) VALUES('".$j."','".$j."')";改成
$query1="insert into guestbook (gjxname,Content) VALUES('你好','你好')";一样不插入啊