@@ -17,6 +17,7 @@ function where it is needed, or in your class constructor to make the
1717database available globally in that class.
1818
1919.. literalinclude :: connecting/001.php
20+ :lines: 2-
2021
2122If the above function does **not ** contain any information in the first
2223parameter, it will connect to the default group specified in your database config
@@ -26,6 +27,7 @@ A convenience method exists that is purely a wrapper around the above line
2627and is provided for your convenience:
2728
2829.. literalinclude :: connecting/002.php
30+ :lines: 2-
2931
3032Available Parameters
3133--------------------
@@ -45,6 +47,7 @@ specify a particular database group from your config file. Examples:
4547To choose a specific group from your config file you can do this:
4648
4749.. literalinclude :: connecting/003.php
50+ :lines: 2-
4851
4952Where ``group_name `` is the name of the connection group from your config
5053file.
@@ -57,6 +60,7 @@ database connection every time. If you need to have a separate connection
5760to the same database, send ``false `` as the second parameter:
5861
5962.. literalinclude :: connecting/004.php
63+ :lines: 2-
6064
6165Connecting to Multiple Databases
6266================================
@@ -65,6 +69,7 @@ If you need to connect to more than one database simultaneously you can
6569do so as follows:
6670
6771.. literalinclude :: connecting/005.php
72+ :lines: 2-
6873
6974Note: Change the words ``group_one `` and ``group_two `` to the specific
7075group names you are connecting to.
@@ -82,6 +87,7 @@ a connection that uses your custom settings. The array passed in must be
8287the same format as the groups are defined in the configuration file:
8388
8489.. literalinclude :: connecting/006.php
90+ :lines: 2-
8591
8692Reconnecting / Keeping the Connection Alive
8793===========================================
@@ -96,6 +102,7 @@ or re-establish it.
96102 does not ping the server but it closes the connection then connects again.
97103
98104.. literalinclude :: connecting/007.php
105+ :lines: 2-
99106
100107Manually Closing the Connection
101108===============================
@@ -104,3 +111,4 @@ While CodeIgniter intelligently takes care of closing your database
104111connections, you can explicitly close the connection.
105112
106113.. literalinclude :: connecting/008.php
114+ :lines: 2-
0 commit comments