* WordPress database access abstraction class
* Original code from {@link http://php.justinvincent.com Justin Vincent (justin@visunet.ie)}
define( 'EZSQL_VERSION', 'WP1.25' );
define( 'OBJECT', 'OBJECT' );
// phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
define( 'object', 'OBJECT' ); // Back compat.
define( 'OBJECT_K', 'OBJECT_K' );
define( 'ARRAY_A', 'ARRAY_A' );
define( 'ARRAY_N', 'ARRAY_N' );
* WordPress database access abstraction class.
* This class is used to interact with a database without needing to use raw SQL statements.
* By default, WordPress uses this class to instantiate the global $wpdb object, providing
* access to the WordPress database.
* It is possible to replace this class with your own by setting the $wpdb global variable
* in wp-content/db.php file to your class. The wpdb class will still be included, so you can
* extend it or simply use your own.
* @link https://developer.wordpress.org/reference/classes/wpdb/
* Whether to show SQL/DB errors.
* Default is to show errors if both WP_DEBUG and WP_DEBUG_DISPLAY evaluate to true.
public $show_errors = false;
* Whether to suppress errors during the DB bootstrapping. Default false.
public $suppress_errors = false;
* The error encountered during the last query.
* The number of queries made.
* Count of rows returned by the last query.
* Count of rows affected by the last query.
public $rows_affected = 0;
* The ID generated for an AUTO_INCREMENT column by the last query (usually INSERT).
* Results of the last query.
* MySQL result, which is either a resource or boolean.
* Cached column info, for sanity checking data before inserting.
protected $col_meta = array();
* Calculated character sets on tables.
protected $table_charset = array();
* Whether text fields in the current query need to be sanity checked. Default false.
protected $check_current_query = true;
* Flag to ensure we don't run into recursion problems when checking the collation.
* @see wpdb::check_safe_collation()
private $checking_collation = false;
* Saved info on the table column.
* Log of queries that were executed, for debugging purposes.
* @since 2.5.0 The third element in each query log was added to record the calling functions.
* @since 5.1.0 The fourth element in each query log was added to record the start time.
* @since 5.3.0 The fifth element in each query log was added to record custom data.
* Array of queries that were executed.
* @type string $0 The query's SQL.
* @type float $1 Total time spent on the query, in seconds.
* @type string $2 Comma-separated list of the calling functions.
* @type float $3 Unix timestamp of the time at the start of the query.
* @type array $4 Custom query data.
* The number of times to retry reconnecting before dying. Default 5.
* @see wpdb::check_connection()
protected $reconnect_retries = 5;
* You can set this to have multiple WordPress installations in a single database.
* The second reason is for possible security precautions.
* WordPress base table prefix.
* Whether the database queries are ready to start executing.
* List of WordPress per-blog tables.
* List of deprecated WordPress tables.
* 'categories', 'post2cat', and 'link2cat' were deprecated in 2.3.0, db version 5539.
public $old_tables = array( 'categories', 'post2cat', 'link2cat' );
* List of WordPress global tables.
public $global_tables = array( 'users', 'usermeta' );
* List of Multisite global tables.
public $ms_global_tables = array(
* WordPress Comments table.
* WordPress Comment Metadata table.
* WordPress Options table.
* WordPress Post Metadata table.
* WordPress Term Relationships table.
public $term_relationships;
* WordPress Term Taxonomy table.
* WordPress Term Meta table.
// Global and Multisite tables
* WordPress User Metadata table.
* Multisite Blog Metadata table.
* Multisite Registration Log table.
public $registration_log;
* Multisite Signups table.
* Multisite Sitewide Terms table.
* Multisite Site Metadata table.
* Format specifiers for DB columns.
* Columns not listed here default to %s. Initialized during WP load.
* Keys are column names, values are format types: 'ID' => '%d'.
* @see wp_set_wpdb_vars()
public $field_types = array();
* Database table columns charset.
* Database table columns collate.