I'm trying to make a function in which, when a button is pressed, PHP deletes that record from within the database. The website is being redirected with the correct ID, and the DeleteID Variable has the correct value in it, yet for some reason I can't get it to delete the record
Delete.PHP
<?php
session_start();
//get value of ?id= from the url
$DeleteID = $_GET['id'];
echo $DeleteID;
require("connect.php");
//Linking
$link = connectToDB();
//SQL Query
$sql = "DELETE
FROM tbl_property
WHERE propetyid = $DeleteID";
//Execute
$result = $link->query($sql);
//Check
if ($link->affected_rows == 1) {
echo "Worked";
echo "<a href='properties.php'> SIGH </a>";
}
else {
echo "Didn't Work";
echo "<a href='properties.php'> SIGH </a>";
}
?>
Table