summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database/connecting.rst
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-07-04 11:32:14 +0200
committerAndrey Andreev <narf@bofh.bg>2012-07-04 11:32:14 +0200
commitb94b91afc77bcc133ff282559015933602bb2d3f (patch)
tree08329d26cfbe5e4aecde1f780c642380e1286105 /user_guide_src/source/database/connecting.rst
parent474674f8402e3f6198fb2c99a78b6ec2eb80710a (diff)
Some user guide updates
Diffstat (limited to 'user_guide_src/source/database/connecting.rst')
-rw-r--r--user_guide_src/source/database/connecting.rst34
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