/    Sign up×
Community /Pin to ProfileBookmark

In CodeIgniter: changing database driver to "mysqli" doesn’t work?

Everything ran fine yesterday. Today, magically, I was victim of the infamous “white screen of death”. The PHP pages kept being served blank. Being new at this, and not knowing better, I re-installed XAMPP (with which I run CodeIgniter). I had to edit my php.ini file once again, and insert all the necessary information, like the mysql.default_port, mysql.default_socket, mysql.default_host and mysql.default_user.

Having googled my problem, I found a way for me to know what was causing all of this:

[INDENT][B]A PHP Error was encountered
Severity: 8192
Message: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
Filename: config/database.php
Line Number: 80[/B]
[/INDENT]

So, I went onto my database.php in CI, and changed $db[‘default’][‘dbdriver’] = ‘mysql’; to $db[‘default’][‘dbdriver’] = ‘mysqli’;
I come back to my php page, and the error hasn’t gone away. What should I do?

Here’s my whole database.php:

[INDENT][B]$active_group = ‘default’;
$active_record = TRUE;

$db[‘default’][‘hostname’] = ‘localhost’;
$db[‘default’][‘username’] = ‘root’;
$db[‘default’][‘password’] = ”;
$db[‘default’][‘database’] = ‘db’;
$db[‘default’][‘dbdriver’] = ‘mysqli’;
$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;
$db[‘default’][‘port’] = “3306”;[/B]
[/INDENT]

Thanks in advance!

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @thisisabanana spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...