SQL (category)

dbDelta()

Creates or modifies database tables based on the specified SQL query to create table.

esc_sql()

Prepares data for use in a MySQL query. Protects against SQL injections. May accept an array of strings for processing.

get_meta_sql()

Creates the JOIN and WHERE parts of the SQL query for metadata based on the provided parameters, which can be used in the main query.

get_num_queries()

Gets the number of queries that have been made to the WordPress database before this function is called.

get_posts_by_author_sql()

Retrieves WHERE part of the SQL query where posts with 'private' post status for authenticated users will be taken into account.

like_escape()

Use instead of wpdb::esc_like(). Prepares a string for use in a SQL query LIKE expression. Since version 4.0, it is considered deprecated!

sanitize_sql_orderby()

Checks if the provided string can be used in the ORDER BY part of an SQL query.

wpdb::get_var()

Gets the value of a single cell from the query result. By default, the first cell is taken — this is the first column and the first row.