Hi All,
I have a simple 'delete record' code that is not working. Would someone please take a gander at it and let me know if they see anything wrong that would prevent it from actually deleting a record.
<?php
//connects to the database
include ('db_connect.php');
//post variable
$pk = $_POST['pk'];
//MySQL code to query ---- 'contacts' = table & 'primary_key' = record id #
$deleteContact = "DELETE FROM `contacts` WHERE `primary_key` = ".$pk." LIMIT 1";
//excutes query to MySQL
$res = mysqli_query($link,$deleteContact);
//close connection to database
mysqli_close($link);
?>
Any help would be great.
Thank you.