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()

Given a meta query, generates SQL clauses to be appended to a main query.

get_num_queries()

Retrieve the number of database queries during the WordPress execution.

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()

Formerly used to escape strings before searching the DB. It was poorly documented and never worked as described.

sanitize_sql_orderby()

Ensures a string is a valid SQL 'order by' clause.

wpdb::get_var()

Retrieves one variable from the database.