diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-07-04 11:32:14 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-07-04 11:32:14 +0200 |
commit | b94b91afc77bcc133ff282559015933602bb2d3f (patch) | |
tree | 08329d26cfbe5e4aecde1f780c642380e1286105 /user_guide_src/source/database/connecting.rst | |
parent | 474674f8402e3f6198fb2c99a78b6ec2eb80710a (diff) |
Some user guide updates
Diffstat (limited to 'user_guide_src/source/database/connecting.rst')
-rw-r--r-- | user_guide_src/source/database/connecting.rst | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/user_guide_src/source/database/connecting.rst b/user_guide_src/source/database/connecting.rst index 5822ca62c..9b8117076 100644 --- a/user_guide_src/source/database/connecting.rst +++ b/user_guide_src/source/database/connecting.rst @@ -57,25 +57,28 @@ file. To connect manually to a desired database you can pass an array of values:: - $config['hostname'] = "localhost"; - $config['username'] = "myusername"; - $config['password'] = "mypassword"; - $config['database'] = "mydatabase"; - $config['dbdriver'] = "mysql"; - $config['dbprefix'] = ""; - $config['pconnect'] = FALSE; - $config['db_debug'] = TRUE; - $config['cache_on'] = FALSE; - $config['cachedir'] = ""; - $config['char_set'] = "utf8"; - $config['dbcollat'] = "utf8_general_ci"; + $config['hostname'] = 'localhost'; + $config['username'] = 'myusername'; + $config['password'] = 'mypassword'; + $config['database'] = 'mydatabase'; + $config['dbdriver'] = 'mysqli'; + $config['dbprefix'] = ''; + $config['pconnect'] = FALSE; + $config['db_debug'] = TRUE; + $config['cache_on'] = FALSE; + $config['cachedir'] = ''; + $config['char_set'] = 'utf8'; + $config['dbcollat'] = 'utf8_general_ci'; $this->load->database($config); For information on each of these values please see the :doc:`configuration page <configuration>`. -.. note:: For the PDO driver, $config['hostname'] should look like - this: 'mysql:host=localhost' +.. note:: For the PDO driver, you should use the $config['dsn'] setting + instead of 'hostname' and 'database': + + | + | $config['dsn'] = 'mysql:host=localhost;dbname=mydatabase'; Or you can submit your database values as a Data Source Name. DSNs must have this prototype:: @@ -149,5 +152,4 @@ connections, you can explicitly close the connection. :: - $this->db->close(); - + $this->db->close();
\ No newline at end of file |