Skip to content

Commit b93a901

Browse files
committed
docs: do not show unneeded <?php in sample code
1 parent df4e640 commit b93a901

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

user_guide_src/source/database/connecting.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function where it is needed, or in your class constructor to make the
1717
database available globally in that class.
1818

1919
.. literalinclude:: connecting/001.php
20+
:lines: 2-
2021

2122
If the above function does **not** contain any information in the first
2223
parameter, 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
2627
and is provided for your convenience:
2728

2829
.. literalinclude:: connecting/002.php
30+
:lines: 2-
2931

3032
Available Parameters
3133
--------------------
@@ -45,6 +47,7 @@ specify a particular database group from your config file. Examples:
4547
To choose a specific group from your config file you can do this:
4648

4749
.. literalinclude:: connecting/003.php
50+
:lines: 2-
4851

4952
Where ``group_name`` is the name of the connection group from your config
5053
file.
@@ -57,6 +60,7 @@ database connection every time. If you need to have a separate connection
5760
to the same database, send ``false`` as the second parameter:
5861

5962
.. literalinclude:: connecting/004.php
63+
:lines: 2-
6064

6165
Connecting to Multiple Databases
6266
================================
@@ -65,6 +69,7 @@ If you need to connect to more than one database simultaneously you can
6569
do so as follows:
6670

6771
.. literalinclude:: connecting/005.php
72+
:lines: 2-
6873

6974
Note: Change the words ``group_one`` and ``group_two`` to the specific
7075
group names you are connecting to.
@@ -82,6 +87,7 @@ a connection that uses your custom settings. The array passed in must be
8287
the same format as the groups are defined in the configuration file:
8388

8489
.. literalinclude:: connecting/006.php
90+
:lines: 2-
8591

8692
Reconnecting / 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

100107
Manually Closing the Connection
101108
===============================
@@ -104,3 +111,4 @@ While CodeIgniter intelligently takes care of closing your database
104111
connections, you can explicitly close the connection.
105112

106113
.. literalinclude:: connecting/008.php
114+
:lines: 2-

0 commit comments

Comments
 (0)