Welcome Guest, Not a member yet? Register   Sign In
MySQL Driver Error
#1

[eluser]andika[/eluser]
Hi guys,

Please your help. I've error message in my website :

Call to undefined method CI_DB_mysql_driver::_protect_identifiers() in /system/database/DB_active_rec.php on line 451

Line 451 :
$k = $this->_protect_identifiers($k, FALSE, $escape);

How to solve that error? Please anyone help me.

Regards,
Andika
#2

[eluser]WanWizard[/eluser]
Which version of CI? How to you load the database? Have you tampered with the code?

_protect_identifiers() is defined in DB_driver.php, which is loaded as soon as you create a database connection (and you can't do without).
#3

[eluser]andika[/eluser]
i user CI version 1.7.2 and i load the database with :
$db = $this->load->database('default', true);

is there anything wrong? and for your information, before i migrate the website to another server, it looks fine. but after i migrate it, i've that error.

please your help.

[quote author="WanWizard" date="1286032577"]Which version of CI? How to you load the database? Have you tampered with the code?

_protect_identifiers() is defined in DB_driver.php, which is loaded as soon as you create a database connection (and you can't do without).[/quote]
#4

[eluser]WanWizard[/eluser]
No errors in your logs that a class could not be loaded? Are your database settings correct? What is exactly the database statement you're trying to execute?
#5

[eluser]InsiteFX[/eluser]
Show your your database config file without password!

InsiteFX
#6

[eluser]andika[/eluser]
this is my database config file.

$active_group = "default";
$active_record = TRUE;

$db = array(
'default' => array(
'hostname' => 'localhost',
'username' => 'xxxxxxxxx',
'password' => 'xxxx',
'database' => 'xxxxxxxxx',
'dbdriver' => 'mysql',
'dbprefix' => 'bms_',
'pconnect' => TRUE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci'

[quote author="InsiteFX" date="1286127871"]Show your your database config file without password!

InsiteFX[/quote]
#7

[eluser]gozpel89[/eluser]
try to replace with newwer script form default Ci configuration,.

after that,. uu reconfig it with your configuration
#8

[eluser]InsiteFX[/eluser]
This is WRONG!
Code:
this is my database config file.

$active_group = “default”;
$active_record = TRUE;

$db = array(
‘default’ => array(
‘hostname’ => ‘localhost’,
‘username’ => ‘xxxxxxxxx’,
‘password’ => ‘xxxx’,
‘database’ => ‘xxxxxxxxx’,
‘dbdriver’ => ‘mysql’,
‘dbprefix’ => ‘bms_’,
‘pconnect’ => TRUE,
‘db_debug’ => TRUE,
‘cache_on’ => FALSE,
‘cachedir’ => ‘’,
‘char_set’ => ‘utf8’,
‘dbcollat’ => ‘utf8_general_ci’

Should be like this:
Code:
this is my database config file.

$active_group = “default”;
$active_record = TRUE;

$db = array(
‘hostname’ => ‘localhost’,
‘username’ => ‘xxxxxxxxx’,
‘password’ => ‘xxxx’,
‘database’ => ‘xxxxxxxxx’,
‘dbdriver’ => ‘mysql’,
‘dbprefix’ => ‘bms_’,
‘pconnect’ => TRUE,
‘db_debug’ => TRUE,
‘cache_on’ => FALSE,
‘cachedir’ => ‘’,
‘char_set’ => ‘utf8’,
‘dbcollat’ => ‘utf8_general_ci’
);

You can have multiple group names in the database.php config file,
just use different group names. Then you can load different groups.

InsiteFX
#9

[eluser]InsiteFX[/eluser]
application/config/database.php
Code:
$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "";
$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['default2']['hostname'] = "localhost";
$db['default2']['username'] = "";
$db['default2']['password'] = "";
$db['default2']['database'] = "";
$db['default2']['dbdriver'] = "mysql";
$db['default2']['dbprefix'] = "";
$db['default2']['pconnect'] = TRUE;
$db['default2']['db_debug'] = TRUE;
$db['default2']['cache_on'] = FALSE;
$db['default2']['cachedir'] = "";
$db['default2']['char_set'] = "utf8";
$db['default2']['dbcollat'] = "utf8_general_ci";

Now all you need to do is load the group name you want!
Code:
$active_group = "default2";

InsiteFX
#10

[eluser]andika[/eluser]
i've changed it with your script below. but nothing changes. and then i try to re-install CI again from beginning, and it works. thanks for anyone.

[quote author="InsiteFX" date="1286183808"]application/config/database.php
Code:
$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "";
$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['default2']['hostname'] = "localhost";
$db['default2']['username'] = "";
$db['default2']['password'] = "";
$db['default2']['database'] = "";
$db['default2']['dbdriver'] = "mysql";
$db['default2']['dbprefix'] = "";
$db['default2']['pconnect'] = TRUE;
$db['default2']['db_debug'] = TRUE;
$db['default2']['cache_on'] = FALSE;
$db['default2']['cachedir'] = "";
$db['default2']['char_set'] = "utf8";
$db['default2']['dbcollat'] = "utf8_general_ci";

Now all you need to do is load the group name you want!
Code:
$active_group = "default2";

InsiteFX[/quote]




Theme © iAndrew 2016 - Forum software by © MyBB