Welcome Guest, Not a member yet? Register   Sign In
Codeigniter deprecate Message After Moving From 2.1 to 3.0
#5

(12-27-2015, 06:24 AM)Codeigniter_Learner Wrote:
(12-26-2015, 11:53 PM)pmbaldha Wrote: There might be possibility that you php will be upgraded.  Php Mysql is deprecated form latest since 5.5. For refence see http://php.net/manual/en/migration55.deprecated.php. You should move to mysql database driver to mysqli because from php 7 mysql php will be removed from php. Mysqli driver  is very similar to mysql driver.

To move mysql to mysql just go to Application/Config/database.php file and change dbdriver element value to mysqli in $db['default'] array. It's looks like following

$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => '',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'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
);

You can use pdo database driver also instead of mysqli. But I prefer mysqli driver to connect with mysql database due to mysqli has slight more speed performance in compare to pdo for mysql database.

Thanks @pmbaldha, but when I change it to mysqli, I stop getting out put on view..

I have

Code:
else {
echo 'No countries  found'
}
on view

My database is
Code:
$active_group = 'default';
$active_record = TRUE;


$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = '***';
$db['default']['database'] = '***';

$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
Reply


Messages In This Thread
RE: Codeigniter deprecate Message After Moving From 2.1 to 3.0 - by Codeigniter_Learner - 12-27-2015, 06:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB