Welcome Guest, Not a member yet? Register   Sign In
Specifying Session Database
#5

[eluser]Aken[/eluser]
Extending and modifying a library is not hacking. That's why the ability to extend libraries exists - so core files don't need to be altered. So don't worry about that.

Without seeing how you've tried to modify the library, I can't comment on why part of your code works and the other doesn't. There's nothing special about how the session library uses active record. It uses the same database connection as if you were to use $this->db in your controller or model. In other words, whichever DB connection you specify as the default in your DB config file. If you want to use a different database in your session library, you need to modify all instances of $this->CI->db to your own DB, usually done like this:

Code:
$mydb = $this->CI->load->database('dbset', true);

See "Connecting to multiple databases" for a bit more on that.


Messages In This Thread
Specifying Session Database - by El Forum - 11-06-2012, 11:27 PM
Specifying Session Database - by El Forum - 11-07-2012, 01:43 AM
Specifying Session Database - by El Forum - 11-07-2012, 03:59 PM
Specifying Session Database - by El Forum - 11-07-2012, 06:18 PM
Specifying Session Database - by El Forum - 11-07-2012, 07:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB