Currently I have an external php script trying to delete a row from the blog table, this should be done by the id variable pulled via the post method. Current code:
<?php
include 'dbconnection.php';
$id = $_POST['id'];
$query = "DELETE FROM 'blog' WHERE id = $id";
if(mysqli_query($conn, $query)){
header("location: adminDeleteComplete.php");
} else {
header("location: adminDeleteFailed.php");
}
?>
HTML section:
<form method="post" action="adminDeleter.php">
<input type="text" name="id" placeholder="ID" value="<?php echo $id ?>">
<input type="text" name="title" placeholder="Title" value="<?php echo $title ?>">
<input type="text" name="subtitle" placeholder="Subtitle" value="<?php echo $subtitle ?>" required>
<textarea type="text" name="message" required><?php echo $content ?></textarea>
<button class="SUB">Delete Post!</button>
</form>
Can anyone explain what I'm doing wrong? I understood and completed the add and updates section of the blog website but for some strange reason it won't delete?