here is my JS code:

```
$.ajax({
            url: 'login.php',
            type: 'POST',
            data: {
            loginName:  $("#loginName").val(),
            loginPass:  $("#loginPass").val()
            },
            dataType: 'json', 
            success: function(data){
                if(data.success){
                    $("#Message").fadeIn(function(){
                        $(this).html(data.message);
                    });
                }
                else
                {
                    $("#Message").fadeIn(function(){
                        $(this).html(data.message);
                    });
                }
            }
        });

```

and here is PHP:

```
<?php
$data = array();
$data['success'] = true;
$data['message'] = "Here is the message";
echo json_encode($data);
?>

```

If i have this its be all right, but if i edit the php file to this:

```
<?
    include "db.php";
    $data = array();
    if($_SERVER['REQUEST_METHOD'] == 'POST'){
        if($_POST['loginName'] == "" && $_POST['loginPass'] == "")
        {
            @$v = mysql_query("SELECT * FROM users WHERE name LIKE '$registerName'");
            @$p = mysql_num_rows($v);
            if ($p == 0){
                @$v = mysql_query("INSERT INTO users VALUES('','$registerName','$registerPass')");
                $data['message'] = "Byly jste úspěšně zaregistrováni.";
                $data['success'] = true;
            }
            else
            {
                $data['message'] = "Tento uživatel je tu již zaregistrován.";
                $data['success'] = false;
            }

        echo json_encode($data);
    }
?>

```

The ajax do nothing... its just send data but nothing to the alert... :(
and i control this mysql events and its works if i use just php...