PHP SQL and Android
<p>i create a program in Android (login) that send id to a php page then the phppage check if that id in the database or not.the php page send acknowledgement to the android application then compare the received data  with null if it not null then the login successful.
but i have a problem with the compare step i convert the received data to string then do the compare operation ,if i receive null and compare it to null the if statement can not catch it. 
the my php page :</p>

<pre><code>&lt;?php
$data = file_get_contents('php://input');
$json = json_decode($data);
$id=$json-&gt;{'im'};
$con = mysql_connect('localhost','root','1111');
mysql_select_db('root') or die(' ');
$sql = "SELECT name FROM chiled WHERE `im` LIKE $id ";
$query = mysql_query( $sql );

$a=mysql_fetch_row($query);

print(json_encode($a[0]));

mysql_close();
?&gt;
</code></pre>

<p>This is the android app :</p>

<pre><code>try {
            HttpPost post = new HttpPost(path);

             json.put("im", id);

             Toast.makeText( getApplicationContext(),"after put the data in json ",Toast.LENGTH_SHORT).show();
//             
            Log.i("jason Object", json.toString());
            post.setHeader("json", json.toString());
            StringEntity se = new StringEntity(json.toString());
            se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE,"application/json"));
            post.setEntity(se);

            response = client.execute(post);
            /* Checking response */
            if (response != null) {// the response can not be null even if i did not send a data  
                InputStream in = response.getEntity().getContent(); // 
                String recievedData = convertStreamToString(in);




                if (!recievedData .equals(null)){
                    Toast.makeText( getApplicationContext(),"**LOGIN SUCCESSFUL YOU CAN DO ANYTHING***",Toast.LENGTH_SHORT).show();
                }
                else {
                    Toast.makeText( getApplicationContext(),"&lt;&lt;&lt;&lt; LOGIN FAILD GOODBY &gt;&gt;&gt;&gt;",Toast.LENGTH_SHORT).show();

                }
</code></pre>
