Is there a way to have Codeigniter automatically create a db with name specified in config file if it does not exist | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

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

Hi everyone I need to write migrations for codeigniter. But l don't whant 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 :D Thank you

14th Mar 2019, 3:24 PM
Mary Aslanyan
Mary Aslanyan - avatar
1 Answer
+ 3
//You can create by following SQL query CREATE DATABASE helloDB; //MORE info https://www.w3schools.com/Php/php_mysql_create.asp
18th Mar 2019, 7:45 PM
Sudarshan Rai
Sudarshan Rai - avatar