Cancel Php script
<p>From an Android application, the app will query a php script and look for new messages in MySQL DataBase.<br/>
In order to prevent pointless use of the data, I implemented an 'if' statement, to check if the message in database is empty. If the message is empty, it should not answer to the Android application.</p>

<p>My problem &amp; php code:<br/>
The if Statement is not detected and it keeps returning data :</p>

<pre><code> &lt;?php
 if($_REQUEST['pass'] == null){
     die("You Are Not Logged In");
 }

 $q=mysql_query("SELECT * FROM $tbl_name WHERE pass='".$_REQUEST['pass']."'");
 while($e=mysql_fetch_assoc($q)){
    $result1=$e['message'];

    ////Here the Message = 'No Message' but the Scrpit Continue ...

    if($result1 == 'No Message'){
       exit(0);
       die("No Message");
    }
    $output[]=$e;

    print(json_encode($output));

 }   

 if($_REQUEST['status'] != null){
     $sq2="UPDATE $tbl_name SET status='".$_REQUEST['status']."' WHERE  pass='".$_REQUEST['pass']."'";
 $result=mysql_query($sq2);
 }
 mysql_close();


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