This delete clause doesn’t work on my PHP scripts, but my other delete clause works. When I even run the query using phpMyAdmin it works. I can’t see any syntax error; what’s going wrong?
$sql = mysql_query("delete from tbl_albums where album_id = '6'");
if($sql)
{
system('/bin/rm -rf ' . escapeshellarg("../assets/images/gallery/".$id));
}
else
{
echo '<script>alert("Failed to delete album");</script>';
}
You need to use this:
And based on the error, you need to amend your SQL Script. Most probably, the issue would have been because of wrong column name or something else. You need to say what is the error here, so that we can try solving the issue.