problem in sending and receiving data between Android app and php
<p>I'm having a problem sending data from Android app to php page...I have in the android side a button that takes me to this activity:</p>

<pre><code>public class Post extends Activity {

public void postData(View v){
     //Create a new HttpClient and Post Header
        HttpClient httpclient = new DefaultHttpClient();
        HttpPost httppost = new HttpPost("http://192.168.1.67/phptester/insertdata.php"); 
        List&lt;BasicNameValuePair&gt; nameValuePairs = new ArrayList&lt;BasicNameValuePair&gt;(4);

        try {
            // Add your data
            nameValuePairs.add(new BasicNameValuePair("id", "1"));
            nameValuePairs.add(new BasicNameValuePair("descr", "Fire"));
            nameValuePairs.add(new BasicNameValuePair("lat", "1.333"));
            nameValuePairs.add(new BasicNameValuePair("lng", "1.333"));

            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); 

            // Execute HTTP Post Request
            HttpResponse response = httpclient.execute(httppost);
            HttpEntity entity = response.getEntity();
            InputStream is = entity.getContent();
            Log.i("postData", response.getStatusLine().toString());



        } catch (IOException e) {
            Log.e("log_tag", "Error in http connection "+e.toString());
        }
}
</code></pre>

<p>}</p>

<p>And this is my php code:</p>

<pre><code>  &lt;?php
   $conn = mysql_connect("localhost", "root", "") or die(mysql_error());

   mysql_select_db("locationdb", $conn);

   if (isset($_POST["id"]) &amp;&amp; isset($_POST['descr']) &amp;&amp; isset($_POST['lat']) &amp;&amp; isset($_POST['lng']))
   {
     $id = $_POST["id"];
     $descr = $_POST["descr"]; 
     $lat = $_POST["lat"];
     $lon = $_POST["lon"];

     $query = mysql_query("INSERT INTO location (ID, Description, lat, lng) VALUES('6', '$descr', '1.666', '1.666')");

     echo "data inserted";
     mysql_query($query);

}

else {

    echo "Not data was intered ".mysql_error() ;
}

?&gt;
</code></pre>

<p>The problem that is killing me is that there is no data being stored in that database and i don't know why!!!! it seems like the php can't get data from the Android app....Any help is appreciated and thanks in advance..</p>
