Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify a database connection on a per-model basis by declaring instance variable #209

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

webquail
Copy link

@webquail webquail commented Jul 8, 2015

The class will automatically use the default database connection, and even load it for you if you haven't yet.

You can specify a database connection on a per-model basis by declaring the _$database instance variable. This is equivalent to calling $this->db->database($this->_database, TRUE).

class Post_model extends MY_Model
{
    public $_database = 'group_name';
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant