phpmigrationcodeigniter-3

Is there a way to have Codeigniter automatically create a db with name specified in config file if it does not exist


I need to write migrations for codeigniter. But l don't want to create db manually. It will be perfect to create db automatically when I run the app at first time. Is there anyone who could help me to do this?


Solution

  • You can use Hook in codeigniter. In hook you can use pre_system hoook. This will Call very early during system execution. For more details you can refer following link for hook in ci. CI hook link