我遇到了Jquery Jtable插件删除方法的问题。变量'email'在页面之间传递到.php文件中。列表操作函数有效,所以我知道它不是连接问题。我的数据库名称是地图。 以下是我的代码: 使用Javascript:
var emailHolder="email@email.com";
var file="c";
function loadForm()
{
$("#my-form" ).dialog( "open" );
}
$(document).ready(function () {
//Prepare jTable
$('#PeopleTableContainer').jtable({
title: 'Table of people',
actions: {
listAction: 'PersonActions.php?action=list&emailHolder='+emailHolder,
deleteAction: 'PersonActions.php?action=delete&emailHolder='+emailHolder+"&fileHolder="+file
},
fields: {
filename: {
key:true,
title: 'File',
width: '40%'
},
email: {
title:'User',
key: true,
create: false,
edit: false,
list:false
}
}
});
Php:
{
$email= $_GET['emailHolder'];
//Delete from database
$result = mysql_query("DELETE FROM maps WHERE (email='$email' and filename = " . $_POST["filename"] . ");");
//Return result to jTable
$jTableResult = array();
$jTableResult['Result'] = "OK";
print json_encode($jTableResult);
}
答案 0 :(得分:0)
我不确定尝试从jtable
中的'email'字段中删除'key'