attaboy Posted March 15, 2012 Share Posted March 15, 2012 $q = mysqli_query($mysqli, "DROP TABLE IF EXIST 'airline_survey'"); if($q){echo "deleted the table airline_survey....<br>";} else{echo "damm... ".mysqli_error($mysqli);} $mysqli is my connection and it works I had no trouble creating the table but I decided to add these few lines in front of the code to create the table and I get this error. damm...You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXIST 'airline_survey'' at line 1 I gotta believe this is really simple but it's got me stumped. Quote Link to comment https://forums.phpfreaks.com/topic/259007-cant-drop-a-table/ Share on other sites More sharing options...
scootstah Posted March 15, 2012 Share Posted March 15, 2012 1. You need to use backticks, not apostrophes. 2. The keyword is "EXISTS" not "EXIST". DROP TABLE IF EXISTS `airline_survey` Quote Link to comment https://forums.phpfreaks.com/topic/259007-cant-drop-a-table/#findComment-1327822 Share on other sites More sharing options...
attaboy Posted March 15, 2012 Author Share Posted March 15, 2012 Thanks!!! I didn't know what a back tick was till now. Quote Link to comment https://forums.phpfreaks.com/topic/259007-cant-drop-a-table/#findComment-1327850 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.