MySQLi DELETE FROM and DROP querys returning false : <p>I am creating a delete account system for my site. Once clicking the button and confirming, it <em>should</em> Delete the entry from the table 'email' matching the users username, and then delete the table with the name as the users username. After all this, it then redirects you back to the login page. </p>

<p>The issue is that when you try to delete the account, it redirects you to the login page as it should, but does not delete the tables. After testing, it is clear that the querys return false, hinting that there is something wrong with my syntax, although when putting it straight into PHPMyAdmin it works.</p>

<p>Your help would be appreciated!</p>

<p><strong><em>I DO NOT WANT REPLY'S COMPLAINING ABOUT THE SECURITY OF MY SYSTEM. IT IS NOT PUBLIC AND I DON'T INTEND TO MAKE IT PUBLIC</em></strong></p>

<p>Here's some code:</p>

<p><strong>PHP script that listens for the button click and contains the querys:</strong></p>

<pre><code>if(isset($_POST['wannadltaccount'])){
         include 'Connect.php';
         $userUsername = $_COOKIE['userName'];
         mysqli_query($conn, 'DELETE FROM email WHERE `user` = "$userUsername"');
         mysqli_query($conn, 'DROP TABLE `$userUsername`');
         echo "&lt;script type='text/javascript'&gt;window.location.href = 'LoginReg.php';&lt;/script&gt;";
        }
</code></pre>
