0

I have just started using CodeIgniter for my PHP application. I need some help regarding database creation. Instead of creating database manually is it possible that when CI application in installed on any server then after starting the apache server, my application should execute some db script file to create DB structure if the DB is empty otherwise skip the DB creation. So every time when the apache server is started or restarted, my CI application should execute this script and check whether the database structure is up to date or not and create it if does not exist or not up to date.

This way I want to make sure that after first install or everytime the application runs the DB is created and ready to use.

Hope I have explained my requirement clearly. Please let me know if any kind of configuration will help me here.

2
  • This may help you to understand the things. stackoverflow.com/questions/2992938/… Commented Oct 22, 2014 at 11:16
  • Thanks Jogesh. That is one of the options. I want to avoid this kind of approach as everytime when the server is restarted my script will be executed which I do not want though I can handle it in the script. I am trying some other solutions. I will update once I am sure those are correct approaches. Commented Oct 29, 2014 at 3:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.