-
wolfgang1983 Senior Member
   
-
Posts: 627
Threads: 271
Joined: Oct 2014
Reputation:
7
06-15-2015, 03:49 AM
(This post was last modified: 06-15-2015, 08:56 AM by wolfgang1983.)
I am trying to understand how PDO working in database.php from here http://www.codeigniter.com/user_guide/da...hlight=pdo but not working
PHP Code: $active_group = 'default'; $query_builder = TRUE;
$db['default'] = array( 'dsn' => 'pgsql:host=localhost;port=3306;dbname=myproject', 'hostname' => 'localhost', 'username' => 'root', 'password' => '*********', 'database' => 'myproject', 'dbdriver' => 'pdo', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => TRUE, 'cache_on' => FALSE, 'cachedir' => '' , 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE );
Question How to use correct?
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
-
Dracula CodeIgniter Contributor
  
-
Posts: 57
Threads: 4
Joined: Nov 2014
Reputation:
2
(06-15-2015, 03:49 AM)riwakawd Wrote: I am trying to understand how PDO working in database.php from here http://www.codeigniter.com/user_guide/da...hlight=pdo but not working
PHP Code: $active_group = 'default'; $query_builder = TRUE;
$db['default'] = array( 'dsn' => 'pgsql:host=localhost;port=3306;dbname=myproject', 'hostname' => 'localhost', 'username' => 'root', 'password' => '*********', 'database' => 'myproject', 'dbdriver' => 'pdo', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => TRUE, 'cache_on' => FALSE, 'cachedir' => '' , 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE );
Question How to use correct?
Try this...
PHP Code: $active_group = 'default'; $query_builder = TRUE;
$db['default'] = array( 'dsn' => 'mysql:host=localhost; dbname=myproject; charset=utf8;', 'hostname' => 'localhost', 'username' => 'root', 'password' => '*********', 'database' => '', 'dbdriver' => 'pdo', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => TRUE, 'cache_on' => FALSE, 'cachedir' => '' , 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE );
-
wolfgang1983 Senior Member
   
-
Posts: 627
Threads: 271
Joined: Oct 2014
Reputation:
7
(06-15-2015, 07:07 AM)Dracula Wrote: (06-15-2015, 03:49 AM)riwakawd Wrote: I am trying to understand how PDO working in database.php from here http://www.codeigniter.com/user_guide/da...hlight=pdo but not working
PHP Code: $active_group = 'default'; $query_builder = TRUE;
$db['default'] = array( 'dsn' => 'pgsql:host=localhost;port=3306;dbname=myproject', 'hostname' => 'localhost', 'username' => 'root', 'password' => '*********', 'database' => 'myproject', 'dbdriver' => 'pdo', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => TRUE, 'cache_on' => FALSE, 'cachedir' => '' , 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE );
Question How to use correct?
Try this...
PHP Code: $active_group = 'default'; $query_builder = TRUE;
$db['default'] = array( 'dsn' => 'mysql:host=localhost; dbname=myproject; charset=utf8;', 'hostname' => 'localhost', 'username' => 'root', 'password' => '*********', 'database' => '', 'dbdriver' => 'pdo', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => TRUE, 'cache_on' => FALSE, 'cachedir' => '' , 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE );
Working am I able to use mysqli in the dsn area?
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
|