好的,我的代码,我可以通过按提交按钮更新编辑的记录,并使用此
$action =(isset($_POST['submit']) ? $_POST['submit'] : null);
if($action!=null) {
$id =(isset($_POST['id']) ? $_POST['id'] : null);
$query="update club set adminApprove='Y' where id=$id";
$result=mysql_query($query);
echo "<br><p style='text-align:center;color:blue'>Club record has been updated</p>";
echo mysql_error();
那么如何创建这样的东西来从数据库中删除呢?谢谢
答案 0 :(得分:0)
$query = "DELETE FROM club WHERE id = $id";
$result = mysql_query($query);
echo "<br><p style='text-align:center;color:blue'>Club record has been DELETED!</p>";
答案 1 :(得分:0)
DELETE FROM table_name
WHERE some_column = some_value
答案 2 :(得分:0)
$query = "DELETE FROM table_name WHERE id=$id";
$result=mysql_query($query);