what is difference between mysqli and pdo connection

There is no difference in security. The main difference between PDO and Mysqli is that PDO supports various databases and mysqli supports only MySQL. MySQLi is also a bit faster. PDO supports 12 different drivers, opposed to MySQLi, which supports MySQL only

 

CI

$active_group = ‘default’;$active_group = ‘default’;$query_builder = TRUE;
$db[‘default’] = array( ‘dsn’ => ‘mysql:host=localhost;dbname=example’, ‘hostname’ => ‘localhost’, ‘username’ => ‘root’, ‘password’ => ”, ‘database’ => ”, ‘dbdriver’ => ‘pdo’, ‘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);

 

mysqli

 

$active_group = ‘default’;$active_group = ‘default’;$query_builder = TRUE;
$db[‘default’] = array( ‘dsn’ => ”, ‘hostname’ => ‘localhost’, ‘username’ => ‘root’, ‘password’ => ”, ‘database’ => ‘example’, ‘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);

 

 

 

 

 

 

 

 

 

 

Advertisements