我创建了一个php脚本来删除我的数据库中的行,但它不起作用。
这是我的剧本:
<?php
session_start();
include '../_database/database.php';
if(isset($_REQUEST['signup_button'])){
$gallery_name=$_REQUEST['gallery_name'];
$sql = "DELETE FROM gallery WHERE gallery_name=$gallery_name";
mysqli_query($database,$sql) or die(mysqli_error($database));
$_SESSION['user_username'] = $user_username;
header('Location: ../home.php'.$user_username);
}
?>
答案 0 :(得分:-1)
试试这个
$sql = "DELETE FROM gallery WHERE gallery_name='" . $gallery_name ."'";