如何检查php是否已执行?

我有一个简单的jquery函数,该函数用于删除数据库中的行,脚本如下:

//

// delete the entry once we have confirmed that it should be deleted
$('.delete').click(function() {
    var parent = $(this).closest('tr');


    $.ajax({
        type: 'get',
        url: 'delete.php', // <- replace this with your url here
        data: 'ajax=1&delete=' + $(this).attr('id'),
        beforeSend: function() {
            parent.animate({'backgroundColor':'#fb6c6c'},300);
        },
        success: function() {
            parent.fadeOut(300,function() {
                parent.remove();
            });
        }
    });        
});

// confirm that it should be deleted
$('.delete').confirm({
    msg:'Do you really want to delete this?',
    timeout:3000
});     }); // ]]></script>

当我在屏幕上单击bitton dalete行,其却在数据库中仍然存在。该如何检查php是否已执行? 我的php文件:

> <?php     $con = mysql_connect("localhost","root",""); if (!$con)   {  
> die('Could not connect: ' . mysql_error());   }
> 
> mysql_select_db("xxx", $con);
> $sql="DELETE FROM
> `submission_values` WHERE  SubmissionId =49";   
> mysql_query($sql,$con);
> 
> ?>

如果它在同一个文件夹中,我应该给哪个URL? 或者只提供名称?在delete.php中操作可行吗?

echo("alert('ok');");

In your php file, you can echo out a response. Then using jQuery's response object, you can check the value of the response to see if the php script ran to that echo line.

You need to trigger some error condition on failure.

First, to check for failure, use this:

if( $e = mysql_error()) {/* report $e */}

Personally I like to return a JSON string containing whether or not the operation was successful and if not what error occurred - this allows you to differentiate between an HTTP issue (which is what .success() and .error() look for), and judge whether or not you should continue or die.