codeigniter set db prefix
Step 1: Open the CodeIgniter configuration file located at application/config/database.php.
Step 2: Locate the 'dbprefix' configuration setting within the $db array.
Step 3: Set the 'dbprefix' value to the desired database table prefix.
Step 4: Save the changes to the configuration file.
Example:
// application/config/database.php
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'your_username',
'password' => 'your_password',
'database' => 'your_database',
'dbdriver' => 'mysqli',
'dbprefix' => 'your_prefix_', // Set your desired database table prefix
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
Replace 'your_prefix_' with the desired prefix for your database tables. Save the changes to the file.