I am working on this system where people can upload posts but for some reason whenever I try using my delete function it doesn't work can anyone help me out?
This is my button
<?php while($row = mysqli_fetch_assoc($res)){ $location = $row['video_location'];?>
<a href="delete.php?id=<?=$row['id'];?>">Delete</a>
<?php }?>
Ignore the fact that some of the code is unrelated.
delete.php
<?php
include "config.php";
$id = $_GET['id'];
$sql = "DELETE FROM meme_vote WHERE id = '$id'";
if(mysqli_query($conn, $sql)) {
header("location:index.php");
}
else {
echo 'Something went wrong!';
}
?>