通过备份删除MySql整个数据库(表和实体)。 有没有办法重新创建它。

I am working on a web project using php CodeIgniter framework. I used lots of tables and entities in my project database. But unfortunately the database is deleted from my localhost and so the backups.

Now it is very time consuming to create the tables and all the entities for my database that i used for my project.

Is there any way to automatically create the tables and entities from my php source code?

Actually if you put your sql codes, to create the tables if they don´t exist, then it is possible to automatically create the tables and entities from your php source code, when the database was deleted.

For example. Try select from… else create table… and retry select… Something like that…