If table exists drop table then create it, if it does not exist just create it
mysql
Solution
Just put `DROP TABLE IF EXISTS `tablename`;` before your `CREATE TABLE` statement.
That statement drops the table if it exists but will not throw an error if it does not.
Problem
I'm stumped, I don't know how to go about doing this. Basically I just want to create a table, but if it exists it needs to be dropped and re-created, not truncated, but if it doesn't exist just create it. Would anyone be able to help?