Seem to be having an error trying to delete a tuble (usernames) from an SQL table using PHP/SQL queries. My current code is as follows:
<html lang="en" >
<body>
<?php
$conn = new mysqli('localhost', 'myUsername', 'myPassword', 'dbName') or die ('Cannot connect to db');
$uname=$_POST['uname'];
$conn->query("DELETE FROM Account WHERE username = $uname");
echo '<script type="text/javascript">';
echo 'alert("-ADMIN-
Removed user successfully!");';
echo 'window.location.href = "admin.php";';
echo '</script>';
?>
</body>
</html>
This exact same code works to delete a post from a website from a differnt table but is not deleting user accounts by username. Any ideas?