我删除了作为链接提供的内容。如果我单击删除我想从数据库中删除一个值,但肯定它不工作......有什么问题?
<td align="center">
<div id="remove">
<a href='#' onclick="removeDesign()">remove</a>
</div>
</td>
function removeDesign()
{
var confirmation = confirm("Are You Sure You Want to Delete This Item?")
if(confirmation == true)
{
$.post('remove.php',{designId : [<?=$_SESSION['designid']?>]});
}
}
remove.php:
<?php
include("config/dbconn.php");
$DesignId=$_POST['designId'];
$sql = "delete from design where id = '".$DesignId."'";
mysql_query($sql);
?>
问题是designid值没有传递给remove.php?任何人都可以展示解决方案吗?
答案 0 :(得分:1)
尝试
$.post("remove.php",{designId : "'" + <?php echo $_SESSION['designid']?> + "'"} );