Lines 3 and 8 here are telling me I have an error.
I know the sql syntax is correct because I can enter it directly and it works.
$kidID = $_POST['remkid'];
$kname = mysqli_fetch_assoc($conn, SELECT name FROM kids WHERE id=`$kidID`);
$name = $kname['name'];
if(isset($_POST['remkid'])) {
mysqli_query($conn, DELETE FROM kids WHERE id=`$kidID`) or die ("Error: " . mysqli_error());
echo "$name was removed from the system.";
}
Here is an included file that houses $conn which I know also works correctly on the other 5 or 6 pages I have created.
<?php
$servername = "*";
$username = "*";
$password = "*";
$dbname = "*";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
?>
Any help is greatly appreciated.