Codeigniter deprecate Message After Moving From 2.1 to 3.0 |
I recently got this script of the web for ajax dropdown populate fields (v 2.1)
I works fine if run with same version but if I try to upgrade to 3.0, I get this error: Quote:A PHP Error was encountered But the script still works. I don't understand this error as I can't find mysql_driver.php or mysql_pconnect either. Please help.
It is the error by PHP, not CodeIgniter.
The mysql extension that provide all `mysql_*()` functions was deprecated on PHP 5.5, and was removed on PHP 7.
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.
(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. Thanks @pmbaldha, but when I change it to mysqli, I stop getting out put on view.. I have Code: else {
(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. |
Welcome Guest, Not a member yet? Register Sign In |