Database prefix in CodeIgniter

You can set database table prefix in codeigniter. To do this,open the database.php file in config folder or application and modify these,
$db[‘default’][‘dbprefix’] = ‘web_admin’; // change to any name
Now when you write these,
$query = $this->db->get_where(‘_admin’, array(‘admin_name’ => $user_name,’password’ => do_hash($user_pass, ‘md5’)));
It will try to find web_admin_admin table of your database.

Advertisements

2 thoughts on “Database prefix in CodeIgniter

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s