Welcome Guest, Not a member yet? Register   Sign In
Running scripts via CLI
#3

(05-05-2015, 11:41 AM)kilishan Wrote: Looks like you're using CodeIgniter 3?

It sounds like your environment is messing with you. Do you happen to be setting up your database under an environment, like development, production, etc? If so, it  will assign cli calls to the development environment. If you have a database setup in config/development/database.php then it should attempt to use that config file. If one doesn't exist there, it will try to use the default config/database.php. So, verify that those files would have the correct information in them. 

Alternatively - realize that your controller should probably never need direct access to the database anyway. That should be handled through your models.

Thanks kilishan for your reply!
Yes, I am using CI 3 and no, i don't have any environments set up. The database login details n config/database.php are correct.

Would you have any example I could follow? I am new to CI but i am intermediate with traditional PHP.

Thanks
Reply


Messages In This Thread
Running scripts via CLI - by Happy Camper - 05-05-2015, 11:33 AM
RE: Running scripts via CLI - by kilishan - 05-05-2015, 11:41 AM
RE: Running scripts via CLI - by Happy Camper - 05-05-2015, 12:57 PM
RE: Running scripts via CLI - by CroNiX - 05-05-2015, 01:05 PM
RE: Running scripts via CLI - by Happy Camper - 05-06-2015, 03:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB