Skip to content

Commit 7dfd334

Browse files
authored
Merge pull request #8825 from obozdag/patch-2
docs: Some typos in database/configuration.rst
2 parents d47eccf + c12915e commit 7dfd334

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

user_guide_src/source/database/configuration.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ prototype:
2929
The name of the class property is the connection name, and can be used
3030
while connecting to specify a group name.
3131

32-
.. note:: The default location of the SQLite3 database is in the **writable** folder.
33-
If you want to change the location, you must set the full path to the new folder.
32+
.. note:: The default location of the SQLite3 database is the **writable** folder.
33+
If you want to change the location, you must set the full path to the new folder (e.g., 'database' => WRITEPATH . 'db/database_name.db').
3434

3535
DSN
3636
---
3737

38-
Some database drivers (such as Postgre, OCI8) requires a full DSN string to connect.
38+
Some database drivers (such as Postgre, OCI8) requires a full DSN (Data Source Name) string to connect.
3939
But if you do not specify a DSN string for a driver that requires it, CodeIgniter
4040
will try to build it with the rest of the provided settings.
4141

@@ -48,7 +48,7 @@ you're using the driver's underlying native PHP extension, like this:
4848
DSN in Universal Manner
4949
^^^^^^^^^^^^^^^^^^^^^^^
5050

51-
You can also set a Data Source Name in universal manner (URL like). In that case DSNs must have this prototype:
51+
You can also set a DSN in universal manner (URL like). In that case DSNs must have this prototype:
5252

5353
.. literalinclude:: configuration/003.php
5454
:lines: 11-14
@@ -113,7 +113,7 @@ Configuring with .env File
113113

114114
You can also save your configuration values within a **.env** file with the current server's
115115
database settings. You only need to enter the values that change from what is in the
116-
default group's configuration settings. The values should be name following this format, where
116+
default group's configuration settings. The values should follow this format, where
117117
``default`` is the group name::
118118

119119
database.default.username = 'root';
@@ -137,11 +137,11 @@ and decode it in the constructor in the Config class:
137137
.. _database-config-explanation-of-values:
138138

139139
*********************
140-
Explanation of Values
140+
Description of Values
141141
*********************
142142

143143
================ ===========================================================================================================
144-
Name Config Description
144+
Config Name Description
145145
================ ===========================================================================================================
146146
**DSN** The DSN connect string (an all-in-one configuration sequence).
147147
**hostname** The hostname of your database server. Often this is 'localhost'.
@@ -154,31 +154,31 @@ Explanation of Values
154154
**DBDriver** The database driver name. The case must match the driver name.
155155
You can set a fully qualified classname to use your custom driver.
156156
Supported drivers: ``MySQLi``, ``Postgre``, ``SQLite3``, ``SQLSRV``, and ``OCI8``.
157-
**DBPrefix** An optional table prefix which will added to the table name when running
157+
**DBPrefix** An optional table prefix which will be added to the table name when running
158158
:doc:`Query Builder <query_builder>` queries. This permits multiple CodeIgniter
159159
installations to share one database.
160160
**pConnect** true/false (boolean) - Whether to use a persistent connection.
161-
**DBDebug** true/false (boolean) - Whether to throw exceptions or not when database errors occur.
161+
**DBDebug** true/false (boolean) - Whether to throw exceptions when database errors occur.
162162
**charset** The character set used in communicating with the database.
163163
**DBCollat** (``MySQLi`` only) The character collation used in communicating with the database.
164164
**swapPre** A default table prefix that should be swapped with ``DBPrefix``. This is useful for distributed
165165
applications where you might run manually written queries, and need the prefix to still be
166166
customizable by the end user.
167167
**schema** (``Postgre`` and ``SQLSRV`` only) The database schema, default value varies by driver.
168-
**encrypt** (``MySQLi`` and ``SQLSRV`` only) Whether or not to use an encrypted connection.
168+
**encrypt** (``MySQLi`` and ``SQLSRV`` only) Whether to use an encrypted connection.
169169
See :ref:`MySQLi encrypt <mysqli-encrypt>` for ``MySQLi`` settings.
170170
``SQLSRV`` driver accepts true/false.
171-
**compress** (``MySQLi`` only) Whether or not to use client compression.
171+
**compress** (``MySQLi`` only) Whether to use client compression.
172172
**strictOn** (``MySQLi`` only) true/false (boolean) - Whether to force "Strict Mode" connections, good for ensuring
173173
strict SQL while developing an application.
174174
**port** The database port number - Empty string ``''`` for default port (or dynamic port with ``SQLSRV``).
175-
**foreignKeys** (``SQLite3`` only) true/false (boolean) - Whether or not to enable Foreign Key constraint.
175+
**foreignKeys** (``SQLite3`` only) true/false (boolean) - Whether to enable Foreign Key constraint.
176176

177177
.. important:: SQLite3 Foreign Key constraint is disabled by default.
178178
See `SQLite documentation <https://www.sqlite.org/pragma.html#pragma_foreign_keys>`_.
179179
To enforce Foreign Key constraint, set this config item to true.
180180
**busyTimeout** (``SQLite3`` only) milliseconds (int) - Sleeps for a specified amount of time when a table is locked.
181-
**numberNative** (``MySQLi`` only) true/false (boolean) - Whether or not to enable MYSQLI_OPT_INT_AND_FLOAT_NATIVE.
181+
**numberNative** (``MySQLi`` only) true/false (boolean) - Whether to enable MYSQLI_OPT_INT_AND_FLOAT_NATIVE.
182182
**dateFormat** The default date/time formats as PHP's `DateTime format`_.
183183
* ``date`` - date format
184184
* ``datetime`` - date and time format
@@ -225,4 +225,4 @@ MySQLi driver accepts an array with the following options:
225225
* ``ssl_ca`` - Path to the certificate authority file
226226
* ``ssl_capath`` - Path to a directory containing trusted CA certificates in PEM format
227227
* ``ssl_cipher`` - List of *allowed* ciphers to be used for the encryption, separated by colons (``:``)
228-
* ``ssl_verify`` - true/false; Whether to verify the server certificate or not
228+
* ``ssl_verify`` - true/false (boolean) - Whether to verify the server certificate or not

user_guide_src/source/database/helpers.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ $db->countAll()
4242

4343
Permits you to determine the number of rows in a particular table.
4444
Submit the table name in the first parameter. This is part of Query Builder.
45-
Example:
4645

4746
.. literalinclude:: helpers/001.php
4847

@@ -51,7 +50,6 @@ $db->countAllResults()
5150

5251
Permits you to determine the number of rows in a particular result set.
5352
Submit the table name in the first parameter. This is part of Query Builder.
54-
Example:
5553

5654
.. literalinclude:: helpers/002.php
5755

user_guide_src/source/database/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ patterns. The database functions offer clear, simple syntax.
1414
Connecting to a Database <connecting>
1515
Running Queries <queries>
1616
Generating Query Results <results>
17-
Query Helper Functions <helpers>
17+
Query Helper Methods <helpers>
1818
Query Builder Class <query_builder>
1919
Transactions <transactions>
2020
Getting MetaData <metadata>

user_guide_src/source/database/query_builder.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ $query, which can be used to show the results:
8888

8989
.. literalinclude:: query_builder/004.php
9090

91-
Please visit the :doc:`getResult*() method <results>` page for a full
91+
Please visit the :ref:`getResult() <getresult>` method for a full
9292
discussion regarding result generation.
9393

9494
$builder->getCompiledSelect()
@@ -101,14 +101,14 @@ Example:
101101

102102
.. literalinclude:: query_builder/005.php
103103

104-
The first parameter enables you to set whether or not the query builder query
105-
will be reset (by default it will be reset, just like when using ``$builder->get()``):
104+
The parameter (false) in the first query below enables you to set whether or not the query builder
105+
will be reset (because the default value of the parameter is true, ``getCompiledSelect(bool $reset = true)``, by default it will be reset just like when using ``$builder->get()``):
106106

107107
.. literalinclude:: query_builder/006.php
108108

109109
The key thing to notice in the above example is that the second query did not
110110
utilize ``limit(10, 20)`` but the generated SQL query has ``LIMIT 20, 10``.
111-
The reason for this outcome is because the first parameter is set to ``false``.
111+
The reason for this outcome is because the parameter in the first query is set to ``false``, ``limit(10, 20)`` remained in the second query.
112112

113113
$builder->getWhere()
114114
--------------------
@@ -169,7 +169,7 @@ $builder->selectMin()
169169
---------------------
170170

171171
Writes a **SELECT MIN(field)** portion for your query. As with
172-
``selectMax()``, You can optionally include a second parameter to rename
172+
``selectMax()``, you can optionally include a second parameter to rename
173173
the resulting field.
174174

175175
.. literalinclude:: query_builder/011.php
@@ -178,7 +178,7 @@ $builder->selectAvg()
178178
---------------------
179179

180180
Writes a **SELECT AVG(field)** portion for your query. As with
181-
``selectMax()``, You can optionally include a second parameter to rename
181+
``selectMax()``, you can optionally include a second parameter to rename
182182
the resulting field.
183183

184184
.. literalinclude:: query_builder/012.php
@@ -187,7 +187,7 @@ $builder->selectSum()
187187
---------------------
188188

189189
Writes a **SELECT SUM(field)** portion for your query. As with
190-
``selectMax()``, You can optionally include a second parameter to rename
190+
``selectMax()``, you can optionally include a second parameter to rename
191191
the resulting field.
192192

193193
.. literalinclude:: query_builder/013.php
@@ -196,7 +196,7 @@ $builder->selectCount()
196196
-----------------------
197197

198198
Writes a **SELECT COUNT(field)** portion for your query. As with
199-
``selectMax()``, You can optionally include a second parameter to rename
199+
``selectMax()``, you can optionally include a second parameter to rename
200200
the resulting field.
201201

202202
.. note:: This method is particularly helpful when used with ``groupBy()``. For

user_guide_src/source/database/results.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ There are several ways to generate query results:
1212
Result Arrays
1313
*************
1414

15+
.. _getresult:
16+
1517
getResult()
1618
===========
1719

@@ -93,7 +95,7 @@ digit in the first parameter:
9395

9496
.. literalinclude:: results/009.php
9597

96-
In addition, you can walk forward/backwards/first/last through your
98+
In addition, you can walk forward/backward/first/last through your
9799
results using these variations:
98100

99101
| ``$row = $query->getFirstRow()``

0 commit comments

Comments
 (0)