PHP 클래스 wpdb, versionpress

파일 보기 프로젝트 열기: versionpress/versionpress 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$base_prefix string WordPress base table prefix.
$blog_versions string Multisite Blog Versions table
$blogid integer {@internal Missing Description}}
$blogs string Multisite Blogs table
$charset string Database table columns charset
$collate string Database table columns collate
$commentmeta string WordPress Comment Metadata table
$comments string WordPress Comments table
$field_types array Keys are column names, values are format types: 'ID' => '%d'
$func_call string A textual description of the last query/get_row/get_var call
$global_tables array List of WordPress global tables
$insert_id integer The ID generated for an AUTO_INCREMENT column by the previous query (usually INSERT).
$is_mysql boolean Set in WPDB::db_connect() to true, by default. This is used when checking against the required MySQL version for WordPress. Normally, a replacement database drop-in (db.php) will skip these checks, but setting this to true will force the checks to occur.
$last_error string The last error during query.
$last_query array Last query made
$last_result array | null Results of the last query made
$links string WordPress Links table
$ms_global_tables array List of Multisite global tables
$num_queries integer Amount of queries made
$num_rows integer Count of rows returned by previous query
$old_tables array categories, post2cat, and link2cat were deprecated in 2.3.0, db version 5539
$options string WordPress Options table
$postmeta string WordPress Post Metadata table
$posts string WordPress Posts table
$prefix string You can set this to have multiple WordPress installations in a single database. The second reason is for possible security precautions.
$queries array Saved queries that were executed
$ready boolean Whether the database queries are ready to start executing.
$registration_log string Multisite Registration Log table
$rows_affected integer Count of affected rows by previous query
$show_errors boolean Default behavior is to show errors if both WP_DEBUG and WP_DEBUG_DISPLAY evaluated to true.
$signups string Multisite Signups table
$site string Multisite Sites table
$sitecategories string Multisite Sitewide Terms table
$siteid integer {@internal Missing Description}}
$sitemeta string Multisite Site Metadata table
$suppress_errors boolean Whether to suppress errors during the DB bootstrapping.
$tables array List of WordPress per-blog tables
$term_relationships string WordPress Term Relationships table
$term_taxonomy string WordPress Term Taxonomy table
$terms string WordPress Terms table
$usermeta string WordPress User Metadata table
$users string WordPress Users table

보호된 프로퍼티들

프로퍼티 타입 설명
$col_info array Saved info on the table column
$dbh string | mysqli | resource Database Handle
$dbhost string Database Host
$dbname string Database Name
$dbpassword string Database Password
$dbuser string Database Username
$incompatible_modes array A list of incompatible SQL modes.
$reconnect_retries integer The number of times to retry reconnecting before dying.
$result mixed MySQL result, which is either a resource or boolean.

공개 메소드들

메소드 설명
__construct ( string $dbuser, string $dbpassword, string $dbname, string $dbhost ) Connects to the database server and selects a database
__destruct ( ) : boolean PHP5 style destructor and will run when database object is destroyed.
__get ( string $name ) : mixed PHP5 style magic getter, used to lazy-load expensive data.
__isset ( string $name ) : boolean Magic function, for backwards compatibility.
__set ( string $name, mixed $value ) Magic function, for backwards compatibility.
__unset ( string $name ) Magic function, for backwards compatibility.
_escape ( string | array $data ) : string | array Escape data. Works on arrays.
_insert_replace_helper ( string $table, array $data, array | string $format = null, string $type = 'INSERT' ) : integer | false Helper function for insert and replace.
_real_escape ( string $string ) : string Real escape, using mysqli_real_escape_string() or mysql_real_escape_string()
_weak_escape ( string $string ) : string Do not use, deprecated.
bail ( string $message, string $error_code = '500' ) : false | void Wraps errors in a nice header and footer and dies.
check_connection ( boolean $allow_bail = true ) : boolean Check that the connection to the database is still up. If not, try to reconnect.
check_database_version ( ) : WP_Error Whether MySQL database is at least the required minimum version.
db_connect ( boolean $allow_bail = true ) : boolean Connect to and select database.
db_version ( ) : false | string The database version number.
delete ( string $table, array $where, array | string $where_format = null ) : integer | false Delete a row in the table
esc_like ( string $text ) : string First half of escaping for LIKE special characters % and _ before preparing for MySQL.
escape ( mixed $data ) : mixed Do not use, deprecated.
escape_by_ref ( string &$string ) : void Escapes content by reference for insertion into the database, for security
flush ( ) : void Kill cached query results.
get_blog_prefix ( integer $blog_id = null ) : string Gets blog prefix.
get_caller ( ) : string Retrieve the name of the function that called wpdb.
get_charset_collate ( ) : string The database character collate.
get_col ( string | null $query = null, integer $x ) : array Retrieve one column from the database.
get_col_info ( string $info_type = 'name', integer $col_offset ) : mixed Retrieve column metadata from the last query.
get_results ( string $query = null, string $output = OBJECT ) : mixed Retrieve an entire SQL result set from the database (i.e., many rows)
get_row ( string | null $query = null, string $output = OBJECT, integer $y ) : mixed Retrieve one row from the database.
get_var ( string | null $query = null, integer $x, integer $y ) : string | null Retrieve one variable from the database.
has_cap ( string $db_cap ) : boolean Determine if a database supports a particular feature.
hide_errors ( ) : boolean Disables showing of database errors.
init_charset ( ) Set $this->charset and $this->collate
insert ( string $table, array $data, array | string $format = null ) : integer | false Insert a row into a table.
prepare ( string $query, array | mixed $args ) : null | false | string Prepares a SQL query for safe execution. Uses sprintf()-like syntax.
print_error ( string $str = '' ) : boolean Print SQL/DB error.
query ( string $query ) : integer | false Perform a MySQL database query, using current database connection.
replace ( string $table, array $data, array | string $format = null ) : integer | false Replace a row into a table.
select ( string $db, resource $dbh = null ) : null Selects a database using the current database connection.
set_blog_id ( integer $blog_id, integer $site_id ) : string Sets blog id.
set_charset ( resource $dbh, string $charset = null, string $collate = null ) Sets the connection's character set.
set_prefix ( string $prefix, boolean $set_table_names = true ) : string | WP_Error Sets the table prefix for the WordPress tables.
set_sql_mode ( array $modes = [] ) Change the current SQL mode, and ensure its WordPress compatibility.
show_errors ( boolean $show = true ) : boolean Enables showing of database errors.
supports_collation ( ) : boolean Whether the database supports collation.
suppress_errors ( boolean $suppress = true ) : boolean Whether to suppress database errors.
tables ( string $scope = 'all', boolean $prefix = true, integer $blog_id ) : array Returns an array of WordPress tables.
timer_start ( ) : true Starts the timer, for debugging purposes.
timer_stop ( ) : float Stops the debugging timer.
update ( string $table, array $data, array $where, array | string $format = null, array | string $where_format = null ) : integer | false Update a row in the table

보호된 메소드들

메소드 설명
load_col_info ( ) Load the column metadata from the last query.

비공개 메소드들

메소드 설명
_do_query ( string $query ) Internal function to perform the mysql_query() call.

메소드 상세

__construct() 공개 메소드

PHP5 style constructor for compatibility with PHP5. Does the actual setting up of the class properties and connection to the database.
부터: 2.0.8
public __construct ( string $dbuser, string $dbpassword, string $dbname, string $dbhost )
$dbuser string MySQL database user
$dbpassword string MySQL database password
$dbname string MySQL database name
$dbhost string MySQL database host

__destruct() 공개 메소드

PHP5 style destructor and will run when database object is destroyed.
또한 보기: wpdb::__construct()
부터: 2.0.8
public __destruct ( ) : boolean
리턴 boolean true

__get() 공개 메소드

PHP5 style magic getter, used to lazy-load expensive data.
부터: 3.5.0
public __get ( string $name ) : mixed
$name string The private member to get, and optionally process
리턴 mixed The private member

__isset() 공개 메소드

Magic function, for backwards compatibility.
부터: 3.5.0
public __isset ( string $name ) : boolean
$name string The private member to check
리턴 boolean If the member is set or not

__set() 공개 메소드

Magic function, for backwards compatibility.
부터: 3.5.0
public __set ( string $name, mixed $value )
$name string The private member to set
$value mixed The value to set

__unset() 공개 메소드

Magic function, for backwards compatibility.
부터: 3.5.0
public __unset ( string $name )
$name string The private member to unset

_escape() 공개 메소드

Escape data. Works on arrays.
부터: 2.8.0
public _escape ( string | array $data ) : string | array
$data string | array
리턴 string | array escaped

_insert_replace_helper() 공개 메소드

Runs an insert or replace query based on $type argument.
또한 보기: wpdb::prepare()
또한 보기: wpdb::$field_types
또한 보기: wp_set_wpdb_vars()
부터: 3.0.0
public _insert_replace_helper ( string $table, array $data, array | string $format = null, string $type = 'INSERT' ) : integer | false
$table string table name
$data array Data to insert (in column => value pairs). Both $data columns and $data values should be "raw" (neither should be SQL escaped).
$format array | string Optional. An array of formats to be mapped to each of the value in $data. If string, that format will be used for all of the values in $data. A format is one of '%d', '%f', '%s' (integer, float, string). If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
$type string Optional. What type of operation is this? INSERT or REPLACE. Defaults to INSERT.
리턴 integer | false The number of rows affected, or false on error.

_real_escape() 공개 메소드

Real escape, using mysqli_real_escape_string() or mysql_real_escape_string()
또한 보기: mysqli_real_escape_string()
또한 보기: mysql_real_escape_string()
부터: 2.8.0
public _real_escape ( string $string ) : string
$string string to escape
리턴 string escaped

_weak_escape() 공개 메소드

Use esc_sql() or wpdb::prepare() instead.
또한 보기: wpdb::prepare
또한 보기: esc_sql()
사용 중단: 3.6.0
부터: 2.8.0
public _weak_escape ( string $string ) : string
$string string
리턴 string

bail() 공개 메소드

Will not die if wpdb::$show_errors is false.
부터: 1.5.0
public bail ( string $message, string $error_code = '500' ) : false | void
$message string The Error message
$error_code string Optional. A Computer readable string to identify the error.
리턴 false | void

check_connection() 공개 메소드

If this function is unable to reconnect, it will forcibly die, or if after the the template_redirect hook has been fired, return false instead. If $allow_bail is false, the lack of database connection will need to be handled manually.
부터: 3.9.0
public check_connection ( boolean $allow_bail = true ) : boolean
$allow_bail boolean Optional. Allows the function to bail. Default true.
리턴 boolean True if the connection is up.

check_database_version() 공개 메소드

Whether MySQL database is at least the required minimum version.
부터: 2.5.0
public check_database_version ( ) : WP_Error
리턴 WP_Error

db_connect() 공개 메소드

If $allow_bail is false, the lack of database connection will need to be handled manually.
부터: 3.0.0
부터: 3.9.0 $allow_bail parameter added.
public db_connect ( boolean $allow_bail = true ) : boolean
$allow_bail boolean Optional. Allows the function to bail. Default true.
리턴 boolean True with a successful connection, false on failure.

db_version() 공개 메소드

The database version number.
부터: 2.7.0
public db_version ( ) : false | string
리턴 false | string false on failure, version number on success

delete() 공개 메소드

wpdb::delete( 'table', array( 'ID' => 1 ) ) wpdb::delete( 'table', array( 'ID' => 1 ), array( '%d' ) )
또한 보기: wpdb::prepare()
또한 보기: wpdb::$field_types
또한 보기: wp_set_wpdb_vars()
부터: 3.4.0
public delete ( string $table, array $where, array | string $where_format = null ) : integer | false
$table string table name
$where array A named array of WHERE clauses (in column => value pairs). Multiple clauses will be joined with ANDs. Both $where columns and $where values should be "raw".
$where_format array | string Optional. An array of formats to be mapped to each of the values in $where. If string, that format will be used for all of the items in $where. A format is one of '%d', '%f', '%s' (integer, float, string). If omitted, all values in $where will be treated as strings unless otherwise specified in wpdb::$field_types.
리턴 integer | false The number of rows updated, or false on error.

esc_like() 공개 메소드

Use this only before wpdb::prepare() or esc_sql(). Reversing the order is very bad for security. Example Prepared Statement: $wild = '%'; $find = 'only 43% of planets'; $like = $wild . $wpdb->esc_like( $find ) . $wild; $sql = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_content LIKE %s", $like ); Example Escape Chain: $sql = esc_sql( $wpdb->esc_like( $input ) );
부터: 4.0.0
public esc_like ( string $text ) : string
$text string The raw text to be escaped. The input typed by the user should have no extra or deleted slashes.
리턴 string Text in the form of a LIKE phrase. The output is not SQL safe. Call $wpdb::prepare() or real_escape next.

escape() 공개 메소드

Use esc_sql() or wpdb::prepare() instead.
또한 보기: wpdb::prepare()
또한 보기: esc_sql()
사용 중단: 3.6.0
부터: 0.71
public escape ( mixed $data ) : mixed
$data mixed
리턴 mixed

escape_by_ref() 공개 메소드

Escapes content by reference for insertion into the database, for security
부터: 2.3.0
public escape_by_ref ( string &$string ) : void
$string string to escape
리턴 void

flush() 공개 메소드

Kill cached query results.
부터: 0.71
public flush ( ) : void
리턴 void

get_blog_prefix() 공개 메소드

Gets blog prefix.
부터: 3.0.0
public get_blog_prefix ( integer $blog_id = null ) : string
$blog_id integer Optional.
리턴 string Blog prefix.

get_caller() 공개 메소드

Searches up the list of functions until it reaches the one that would most logically had called this method.
부터: 2.5.0
public get_caller ( ) : string
리턴 string The name of the calling function

get_charset_collate() 공개 메소드

The database character collate.
부터: 3.5.0
public get_charset_collate ( ) : string
리턴 string The database character collate.

get_col() 공개 메소드

Executes a SQL query and returns the column from the SQL result. If the SQL result contains more than one column, this function returns the column specified. If $query is null, this function returns the specified column from the previous SQL result.
부터: 0.71
public get_col ( string | null $query = null, integer $x ) : array
$query string | null Optional. SQL query. Defaults to previous query.
$x integer Optional. Column to return. Indexed from 0.
리턴 array Database query result. Array indexed from 0 by SQL result row number.

get_col_info() 공개 메소드

Retrieve column metadata from the last query.
부터: 0.71
public get_col_info ( string $info_type = 'name', integer $col_offset ) : mixed
$info_type string Optional. Type one of name, table, def, max_length, not_null, primary_key, multiple_key, unique_key, numeric, blob, type, unsigned, zerofill
$col_offset integer Optional. 0: col name. 1: which table the col's in. 2: col's max length. 3: if the col is numeric. 4: col's type
리턴 mixed Column Results

get_results() 공개 메소드

Executes a SQL query and returns the entire SQL result.
부터: 0.71
public get_results ( string $query = null, string $output = OBJECT ) : mixed
$query string SQL query.
$output string Optional. Any of ARRAY_A | ARRAY_N | OBJECT | OBJECT_K constants. With one of the first three, return an array of rows indexed from 0 by SQL result row number. Each row is an associative array (column => value, ...), a numerically indexed array (0 => value, ...), or an object. ( ->column = value ), respectively. With OBJECT_K, return an associative array of row objects keyed by the value of each row's first column's value. Duplicate keys are discarded.
리턴 mixed Database query results

get_row() 공개 메소드

Executes a SQL query and returns the row from the SQL result.
부터: 0.71
public get_row ( string | null $query = null, string $output = OBJECT, integer $y ) : mixed
$query string | null SQL query.
$output string Optional. one of ARRAY_A | ARRAY_N | OBJECT constants. Return an associative array (column => value, ...), a numerically indexed array (0 => value, ...) or an object ( ->column = value ), respectively.
$y integer Optional. Row to return. Indexed from 0.
리턴 mixed Database query result in format specified by $output or null on failure

get_var() 공개 메소드

Executes a SQL query and returns the value from the SQL result. If the SQL result contains more than one column and/or more than one row, this function returns the value in the column and row specified. If $query is null, this function returns the value in the specified column and row from the previous SQL result.
부터: 0.71
public get_var ( string | null $query = null, integer $x, integer $y ) : string | null
$query string | null Optional. SQL query. Defaults to null, use the result from the previous query.
$x integer Optional. Column of value to return. Indexed from 0.
$y integer Optional. Row of value to return. Indexed from 0.
리턴 string | null Database query result (as string), or null on failure

has_cap() 공개 메소드

Determine if a database supports a particular feature.
또한 보기: wpdb::db_version()
부터: 2.7.0
public has_cap ( string $db_cap ) : boolean
$db_cap string The feature to check for.
리턴 boolean

hide_errors() 공개 메소드

By default database errors are not shown.
또한 보기: wpdb::show_errors()
부터: 0.71
public hide_errors ( ) : boolean
리턴 boolean Whether showing of errors was active

init_charset() 공개 메소드

Set $this->charset and $this->collate
부터: 3.1.0
public init_charset ( )

insert() 공개 메소드

wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 'bar' ) ) wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
또한 보기: wpdb::prepare()
또한 보기: wpdb::$field_types
또한 보기: wp_set_wpdb_vars()
부터: 2.5.0
public insert ( string $table, array $data, array | string $format = null ) : integer | false
$table string table name
$data array Data to insert (in column => value pairs). Both $data columns and $data values should be "raw" (neither should be SQL escaped).
$format array | string Optional. An array of formats to be mapped to each of the value in $data. If string, that format will be used for all of the values in $data. A format is one of '%d', '%f', '%s' (integer, float, string). If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
리턴 integer | false The number of rows inserted, or false on error.

load_col_info() 보호된 메소드

Load the column metadata from the last query.
부터: 3.5.0
protected load_col_info ( )

prepare() 공개 메소드

The following directives can be used in the query format string: %d (integer) %f (float) %s (string) %% (literal percentage sign - no argument needed) All of %d, %f, and %s are to be left unquoted in the query string and they need an argument passed for them. Literals (%) as parts of the query must be properly written as %%. This function only supports a small subset of the sprintf syntax; it only supports %d (integer), %f (float), and %s (string). Does not support sign, padding, alignment, width or precision specifiers. Does not support argument numbering/swapping. May be called like {@link http://php.net/sprintf sprintf()} or like {@link http://php.net/vsprintf vsprintf()}. Both %d and %s should be left unquoted in the query string. wpdb::prepare( "SELECT * FROM table WHERE column = %s AND field = %d", 'foo', 1337 ) wpdb::prepare( "SELECT DATE_FORMAT(field, '%%c') FROM table WHERE column = %s", 'foo' );
부터: 2.3.0
public prepare ( string $query, array | mixed $args ) : null | false | string
$query string Query statement with sprintf()-like placeholders
$args array | mixed The array of variables to substitute into the query's placeholders if being called like {@link http://php.net/vsprintf vsprintf()}, or the first variable to substitute into the query's placeholders if being called like {@link http://php.net/sprintf sprintf()}.
리턴 null | false | string Sanitized query string, null if there is no query, false if there is an error and string if there was something to prepare

print_error() 공개 메소드

Print SQL/DB error.
부터: 0.71
public print_error ( string $str = '' ) : boolean
$str string The error to display
리턴 boolean False if the showing of errors is disabled.

query() 공개 메소드

More information can be found on the codex page.
부터: 0.71
public query ( string $query ) : integer | false
$query string Database query
리턴 integer | false Number of rows affected/selected or false on error

replace() 공개 메소드

wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 'bar' ) ) wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) )
또한 보기: wpdb::prepare()
또한 보기: wpdb::$field_types
또한 보기: wp_set_wpdb_vars()
부터: 3.0.0
public replace ( string $table, array $data, array | string $format = null ) : integer | false
$table string table name
$data array Data to insert (in column => value pairs). Both $data columns and $data values should be "raw" (neither should be SQL escaped).
$format array | string Optional. An array of formats to be mapped to each of the value in $data. If string, that format will be used for all of the values in $data. A format is one of '%d', '%f', '%s' (integer, float, string). If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
리턴 integer | false The number of rows affected, or false on error.

select() 공개 메소드

The database name will be changed based on the current database connection. On failure, the execution will bail and display an DB error.
부터: 0.71
public select ( string $db, resource $dbh = null ) : null
$db string MySQL database name
$dbh resource Optional link identifier.
리턴 null Always null.

set_blog_id() 공개 메소드

Sets blog id.
부터: 3.0.0
public set_blog_id ( integer $blog_id, integer $site_id ) : string
$blog_id integer
$site_id integer Optional.
리턴 string previous blog id

set_charset() 공개 메소드

Sets the connection's character set.
부터: 3.1.0
public set_charset ( resource $dbh, string $charset = null, string $collate = null )
$dbh resource The resource given by mysql_connect
$charset string The character set (optional)
$collate string The collation (optional)

set_prefix() 공개 메소드

Sets the table prefix for the WordPress tables.
부터: 2.5.0
public set_prefix ( string $prefix, boolean $set_table_names = true ) : string | WP_Error
$prefix string Alphanumeric name for the new prefix.
$set_table_names boolean Optional. Whether the table names, e.g. wpdb::$posts, should be updated or not.
리턴 string | WP_Error Old prefix or WP_Error on error

set_sql_mode() 공개 메소드

If no modes are passed, it will ensure the current MySQL server modes are compatible.
부터: 3.9.0
public set_sql_mode ( array $modes = [] )
$modes array Optional. A list of SQL modes to set.

show_errors() 공개 메소드

This function should be used only to enable showing of errors. wpdb::hide_errors() should be used instead for hiding of errors. However, this function can be used to enable and disable showing of database errors.
또한 보기: wpdb::hide_errors()
부터: 0.71
public show_errors ( boolean $show = true ) : boolean
$show boolean Whether to show or hide errors
리턴 boolean Old value for showing errors.

supports_collation() 공개 메소드

Called when WordPress is generating the table scheme.
사용 중단: 3.5.0
사용 중단: Use wpdb::has_cap( 'collation' )
부터: 2.5.0
public supports_collation ( ) : boolean
리턴 boolean True if collation is supported, false if version does not

suppress_errors() 공개 메소드

By default database errors are suppressed, with a simple call to this function they can be enabled.
또한 보기: wpdb::hide_errors()
부터: 2.5.0
public suppress_errors ( boolean $suppress = true ) : boolean
$suppress boolean Optional. New value. Defaults to true.
리턴 boolean Old value

tables() 공개 메소드

Also allows for the CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE to override the WordPress users and usermeta tables that would otherwise be determined by the prefix. The scope argument can take one of the following: 'all' - returns 'all' and 'global' tables. No old tables are returned. 'blog' - returns the blog-level tables for the queried blog. 'global' - returns the global tables for the installation, returning multisite tables only if running multisite. 'ms_global' - returns the multisite global tables, regardless if current installation is multisite. 'old' - returns tables which are deprecated.
부터: 3.0.0
public tables ( string $scope = 'all', boolean $prefix = true, integer $blog_id ) : array
$scope string Optional. Can be all, global, ms_global, blog, or old tables. Defaults to all.
$prefix boolean Optional. Whether to include table prefixes. Default true. If blog prefix is requested, then the custom users and usermeta tables will be mapped.
$blog_id integer Optional. The blog_id to prefix. Defaults to wpdb::$blogid. Used only when prefix is requested.
리턴 array Table names. When a prefix is requested, the key is the unprefixed table name.

timer_start() 공개 메소드

Starts the timer, for debugging purposes.
부터: 1.5.0
public timer_start ( ) : true
리턴 true

timer_stop() 공개 메소드

Stops the debugging timer.
부터: 1.5.0
public timer_stop ( ) : float
리턴 float Total time spent on the query, in seconds

update() 공개 메소드

wpdb::update( 'table', array( 'column' => 'foo', 'field' => 'bar' ), array( 'ID' => 1 ) ) wpdb::update( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( 'ID' => 1 ), array( '%s', '%d' ), array( '%d' ) )
또한 보기: wpdb::prepare()
또한 보기: wpdb::$field_types
또한 보기: wp_set_wpdb_vars()
부터: 2.5.0
public update ( string $table, array $data, array $where, array | string $format = null, array | string $where_format = null ) : integer | false
$table string table name
$data array Data to update (in column => value pairs). Both $data columns and $data values should be "raw" (neither should be SQL escaped).
$where array A named array of WHERE clauses (in column => value pairs). Multiple clauses will be joined with ANDs. Both $where columns and $where values should be "raw".
$format array | string Optional. An array of formats to be mapped to each of the values in $data. If string, that format will be used for all of the values in $data. A format is one of '%d', '%f', '%s' (integer, float, string). If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
$where_format array | string Optional. An array of formats to be mapped to each of the values in $where. If string, that format will be used for all of the items in $where. A format is one of '%d', '%f', '%s' (integer, float, string). If omitted, all values in $where will be treated as strings.
리턴 integer | false The number of rows updated, or false on error.

프로퍼티 상세

$base_prefix 공개적으로 프로퍼티

WordPress base table prefix.
부터: 3.0.0
public string $base_prefix
리턴 string

$blog_versions 공개적으로 프로퍼티

Multisite Blog Versions table
부터: 3.0.0
public string $blog_versions
리턴 string

$blogid 공개적으로 프로퍼티

{@internal Missing Description}}
부터: 3.0.0
public int $blogid
리턴 integer

$blogs 공개적으로 프로퍼티

Multisite Blogs table
부터: 3.0.0
public string $blogs
리턴 string

$charset 공개적으로 프로퍼티

Database table columns charset
부터: 2.2.0
public string $charset
리턴 string

$col_info 보호되어 있는 프로퍼티

Saved info on the table column
부터: 0.71
protected array $col_info
리턴 array

$collate 공개적으로 프로퍼티

Database table columns collate
부터: 2.2.0
public string $collate
리턴 string

$commentmeta 공개적으로 프로퍼티

WordPress Comment Metadata table
부터: 2.9.0
public string $commentmeta
리턴 string

$comments 공개적으로 프로퍼티

WordPress Comments table
부터: 1.5.0
public string $comments
리턴 string

$dbh 보호되어 있는 프로퍼티

Database Handle
부터: 0.71
protected string|mysqli|resource $dbh
리턴 string | mysqli | resource

$dbhost 보호되어 있는 프로퍼티

Database Host
부터: 3.1.0
protected string $dbhost
리턴 string

$dbname 보호되어 있는 프로퍼티

Database Name
부터: 3.1.0
protected string $dbname
리턴 string

$dbpassword 보호되어 있는 프로퍼티

Database Password
부터: 3.1.0
protected string $dbpassword
리턴 string

$dbuser 보호되어 있는 프로퍼티

Database Username
부터: 2.9.0
protected string $dbuser
리턴 string

$field_types 공개적으로 프로퍼티

Keys are column names, values are format types: 'ID' => '%d'
또한 보기: wpdb::prepare()
또한 보기: wpdb::insert()
또한 보기: wpdb::update()
또한 보기: wpdb::delete()
또한 보기: wp_set_wpdb_vars()
부터: 2.8.0
public array $field_types
리턴 array

$func_call 공개적으로 프로퍼티

A textual description of the last query/get_row/get_var call
부터: 3.0.0
public string $func_call
리턴 string

$global_tables 공개적으로 프로퍼티

List of WordPress global tables
또한 보기: wpdb::tables()
부터: 3.0.0
public array $global_tables
리턴 array

$incompatible_modes 보호되어 있는 프로퍼티

A list of incompatible SQL modes.
부터: 3.9.0
protected array $incompatible_modes
리턴 array

$insert_id 공개적으로 프로퍼티

The ID generated for an AUTO_INCREMENT column by the previous query (usually INSERT).
부터: 0.71
public int $insert_id
리턴 integer

$is_mysql 공개적으로 프로퍼티

Set in WPDB::db_connect() to true, by default. This is used when checking against the required MySQL version for WordPress. Normally, a replacement database drop-in (db.php) will skip these checks, but setting this to true will force the checks to occur.
부터: 3.3.0
public bool $is_mysql
리턴 boolean

$last_error 공개적으로 프로퍼티

The last error during query.
부터: 2.5.0
public string $last_error
리턴 string

$last_query 공개적으로 프로퍼티

Last query made
부터: 0.71
public array $last_query
리턴 array

$last_result 공개적으로 프로퍼티

Results of the last query made
부터: 0.71
public array|null $last_result
리턴 array | null

$ms_global_tables 공개적으로 프로퍼티

List of Multisite global tables
또한 보기: wpdb::tables()
부터: 3.0.0
public array $ms_global_tables
리턴 array

$num_queries 공개적으로 프로퍼티

Amount of queries made
부터: 1.2.0
public int $num_queries
리턴 integer

$num_rows 공개적으로 프로퍼티

Count of rows returned by previous query
부터: 0.71
public int $num_rows
리턴 integer

$old_tables 공개적으로 프로퍼티

categories, post2cat, and link2cat were deprecated in 2.3.0, db version 5539
또한 보기: wpdb::tables()
부터: 2.9.0
public array $old_tables
리턴 array

$options 공개적으로 프로퍼티

WordPress Options table
부터: 1.5.0
public string $options
리턴 string

$postmeta 공개적으로 프로퍼티

WordPress Post Metadata table
부터: 1.5.0
public string $postmeta
리턴 string

$posts 공개적으로 프로퍼티

WordPress Posts table
부터: 1.5.0
public string $posts
리턴 string

$prefix 공개적으로 프로퍼티

You can set this to have multiple WordPress installations in a single database. The second reason is for possible security precautions.
부터: 2.5.0
public string $prefix
리턴 string

$queries 공개적으로 프로퍼티

Saved queries that were executed
부터: 1.5.0
public array $queries
리턴 array

$ready 공개적으로 프로퍼티

Whether the database queries are ready to start executing.
부터: 2.3.2
public bool $ready
리턴 boolean

$reconnect_retries 보호되어 있는 프로퍼티

The number of times to retry reconnecting before dying.
또한 보기: wpdb::check_connection()
부터: 3.9.0
protected int $reconnect_retries
리턴 integer

$registration_log 공개적으로 프로퍼티

Multisite Registration Log table
부터: 3.0.0
public string $registration_log
리턴 string

$result 보호되어 있는 프로퍼티

MySQL result, which is either a resource or boolean.
부터: 0.71
protected mixed $result
리턴 mixed

$rows_affected 공개적으로 프로퍼티

Count of affected rows by previous query
부터: 0.71
public int $rows_affected
리턴 integer

$show_errors 공개적으로 프로퍼티

Default behavior is to show errors if both WP_DEBUG and WP_DEBUG_DISPLAY evaluated to true.
부터: 0.71
public bool $show_errors
리턴 boolean

$signups 공개적으로 프로퍼티

Multisite Signups table
부터: 3.0.0
public string $signups
리턴 string

$site 공개적으로 프로퍼티

Multisite Sites table
부터: 3.0.0
public string $site
리턴 string

$sitecategories 공개적으로 프로퍼티

Multisite Sitewide Terms table
부터: 3.0.0
public string $sitecategories
리턴 string

$siteid 공개적으로 프로퍼티

{@internal Missing Description}}
부터: 3.0.0
public int $siteid
리턴 integer

$sitemeta 공개적으로 프로퍼티

Multisite Site Metadata table
부터: 3.0.0
public string $sitemeta
리턴 string

$suppress_errors 공개적으로 프로퍼티

Whether to suppress errors during the DB bootstrapping.
부터: 2.5.0
public bool $suppress_errors
리턴 boolean

$tables 공개적으로 프로퍼티

List of WordPress per-blog tables
또한 보기: wpdb::tables()
부터: 2.5.0
public array $tables
리턴 array

$term_relationships 공개적으로 프로퍼티

WordPress Term Relationships table
부터: 2.3.0
public string $term_relationships
리턴 string

$term_taxonomy 공개적으로 프로퍼티

WordPress Term Taxonomy table
부터: 2.3.0
public string $term_taxonomy
리턴 string

$terms 공개적으로 프로퍼티

WordPress Terms table
부터: 2.3.0
public string $terms
리턴 string

$usermeta 공개적으로 프로퍼티

WordPress User Metadata table
부터: 2.3.0
public string $usermeta
리턴 string

$users 공개적으로 프로퍼티

WordPress Users table
부터: 1.5.0
public string $users
리턴 string