I'm sending a value to another page. If there is results from a sql query I want to display in an overlay. If there is no results do not display the overlay.

What's happening is that the overlay pops up whether there are results or not. I'm new to this style of version of posting with jquery. I'm used to 'spelling it out' via `$.ajax({});` or plain php.

This is my jquery:

```
$(document).ready(function () 
{
    $("#signup").overlay();

    $('#status').change(function() 
    {
        whoclock=$('#associate').val();
        $.post("ckrd_messsys.php",{asso:whoclock},function(result)
        {
            if(result) 
            {
                $("#signup").overlay().load();
                $("#signup").overlay({mask: '#999', fixed: false,load:true});
                $("#spellout").html(result);
            }
        });
    });

    $("#confirm").click(function() 
    {
        $.post("ckrd_messsys.php",{asso:whoclock,confirmread:"Y"},function(result)
        {
            $("#signup").overlay().close();
        });
    });
});

```

This is my php:

```
$asso = $_REQUEST['asso'];
$confirmread = $_REQUEST['confirmread'];
$getmess = mysql_fetch_array(mysql_query("SELECT `file` FROM `foo` WHERE `empl`='".$asso."' ORDER BY `id` ASC",$con));

if($asso != "")
{
    if(file_exists("message/".$getmess[0].".txt"))
    {
        $txtfile = fopen("message/".$getmess[0].".txt", "r") or exit("Unable to open file!");
        $readIT=fgets($txtfile);
        echo $readIT;
        fclose($txtfile);
    }
 }

```

If there is no txt file I do not want the overlay to load. How do I tell the jquery there is no 'file' or 'result' and not to load?? (Sorry for all the edits....just seems I'm not getting the answers/help I'm after.)

Can I just simply add to my php page:

```
else
{
echo "NOTHING";
}

```

Then change my jquery to something like:

```
if(result != "NOTHING") 
{
....
}

```

I've tried this and it didn't work.