Change DB config |
Hi everyone,
I try to make a login to my DB (directly to the DB, not to a table containing users) But I don't know how could I change the configuration in the default database For example this could be the begining : PHP Code: $db['default'] = array( And then in the controller, change the $username and $passeword with variables so I can login. Can anyone help me in this case ? any tips ?
@arber.smajli,
You can have multiple database configurations. See documentation: https://www.codeigniter.com/user_guide/d...-databases
Thank you for your message
I see what you mean but it's not what I search. I will try to explain you differently ; I am making a database monitor, so to acces to the page, the admin have to connect to the database. So, in first case, the database configuration (application/config/database.php) is empty. And if the admin enter the correct username/passeword (of the database) he is loged on. This is what I can't do for the moment, write in application/config/database.php from a controller. So if anyone has an idea, it would be cool.
You can still use generic MySQLi to access your databases etc;
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(08-01-2018, 11:42 PM)arber.smajli Wrote: Thank you for your message I understand what you are saying. There are many approaches that you an take. I will give you two off the top of my head...
|
Welcome Guest, Not a member yet? Register Sign In |