4343 * By default, WordPress uses this class to instantiate the global $wpdb object, providing
4444 * access to the WordPress database.
4545 *
46- * It is possible to replace this class with your own by setting the $wpdb global variable
46+ * It is possible to replace the global instance with your own by setting the $wpdb global variable
4747 * in wp-content/db.php file to your class. The wpdb class will still be included, so you can
4848 * extend it or simply use your own.
4949 *
@@ -237,7 +237,6 @@ class wpdb {
237237 * WordPress table prefix.
238238 *
239239 * You can set this to have multiple WordPress installations in a single database.
240- * The second reason is for possible security precautions.
241240 *
242241 * @since 2.5.0
243242 *
@@ -941,7 +940,7 @@ public function set_charset( $dbh, $charset = null, $collate = null ) {
941940 /**
942941 * Changes the current SQL mode, and ensures its WordPress compatibility.
943942 *
944- * If no modes are passed, it will ensure the current MySQL server modes are compatible.
943+ * If no modes are passed, it will ensure the current SQL server modes are compatible.
945944 *
946945 * @since 3.9.0
947946 *
@@ -1369,7 +1368,7 @@ public function escape_by_ref( &$data ) {
13691368 }
13701369
13711370 /**
1372- * Quotes an identifier for a MySQL database, e.g. table/ field names .
1371+ * Quotes an identifier such as a table or field name .
13731372 *
13741373 * @since 6.2.0
13751374 *
@@ -1435,6 +1434,13 @@ private function _escape_identifier_value( $identifier ) {
14351434 * 'foo'
14361435 * );
14371436 *
1437+ * $wpdb->prepare(
1438+ * "SELECT * FROM %i WHERE %i = %s",
1439+ * $table,
1440+ * $field,
1441+ * $value
1442+ * );
1443+ *
14381444 * @since 2.3.0
14391445 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter
14401446 * by updating the function signature. The second parameter was changed
@@ -1957,7 +1963,7 @@ public function db_connect( $allow_bail = true ) {
19571963 $ client_flags = defined ( 'MYSQL_CLIENT_FLAGS ' ) ? MYSQL_CLIENT_FLAGS : 0 ;
19581964
19591965 /*
1960- * Set the MySQLi error reporting off because WordPress handles its own.
1966+ * Switch error reporting off because WordPress handles its own.
19611967 * This is due to the default value change from `MYSQLI_REPORT_OFF`
19621968 * to `MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT` in PHP 8.1.
19631969 */
@@ -2100,7 +2106,7 @@ public function parse_db_host( $host ) {
21002106 }
21012107
21022108 $ host = ! empty ( $ matches ['host ' ] ) ? $ matches ['host ' ] : '' ;
2103- // MySQLi port cannot be a string; must be null or an integer.
2109+ // Port cannot be a string; must be null or an integer.
21042110 $ port = ! empty ( $ matches ['port ' ] ) ? absint ( $ matches ['port ' ] ) : null ;
21052111
21062112 return array ( $ host , $ port , $ socket , $ is_ipv6 );
@@ -2290,7 +2296,7 @@ public function query( $query ) {
22902296 if ( $ this ->dbh instanceof mysqli ) {
22912297 $ this ->last_error = mysqli_error ( $ this ->dbh );
22922298 } else {
2293- $ this ->last_error = __ ( 'Unable to retrieve the error message from MySQL ' );
2299+ $ this ->last_error = __ ( 'Unable to retrieve the error message from the database server ' );
22942300 }
22952301
22962302 if ( $ this ->last_error ) {
@@ -3473,7 +3479,7 @@ protected function check_ascii( $input_string ) {
34733479 }
34743480
34753481 /**
3476- * Checks if the query is accessing a collation considered safe on the current version of MySQL .
3482+ * Checks if the query is accessing a collation considered safe.
34773483 *
34783484 * @since 4.2.0
34793485 *
@@ -3987,11 +3993,11 @@ public function close() {
39873993 }
39883994
39893995 /**
3990- * Determines whether MySQL database is at least the required minimum version.
3996+ * Determines whether the database server is at least the required minimum version.
39913997 *
39923998 * @since 2.5.0
39933999 *
3994- * @global string $required_mysql_version The required MySQL version string.
4000+ * @global string $required_mysql_version The minimum required MySQL version string.
39954001 * @return void|WP_Error
39964002 */
39974003 public function check_database_version () {
@@ -4047,7 +4053,7 @@ public function get_charset_collate() {
40474053 *
40484054 * Capability sniffs for the database server and current version of WPDB.
40494055 *
4050- * Database sniffs are based on the version of MySQL the site is using .
4056+ * Database sniffs are based on the version of the database server in use .
40514057 *
40524058 * WPDB sniffs are added as new features are introduced to allow theme and plugin
40534059 * developers to determine feature support. This is to account for drop-ins which may
@@ -4119,7 +4125,7 @@ public function get_caller() {
41194125 }
41204126
41214127 /**
4122- * Retrieves the database server version.
4128+ * Retrieves the database server version number .
41234129 *
41244130 * @since 2.7.0
41254131 *
@@ -4130,11 +4136,11 @@ public function db_version() {
41304136 }
41314137
41324138 /**
4133- * Returns the version of the MySQL server.
4139+ * Returns the raw version string of the database server.
41344140 *
41354141 * @since 5.5.0
41364142 *
4137- * @return string Server version as a string.
4143+ * @return string Database server version as a string.
41384144 */
41394145 public function db_server_info () {
41404146 return mysqli_get_server_info ( $ this ->dbh );
0 commit comments