我有一个简单的 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);
>
> ?>
如果它在同一个文件夹中,我应该提供什么网址?只有像上面这样的名字吗?那应该工作吗?(在删除.php 中)
回声(“警报('ok');”);