A WordPress-centric search engine for devs and theme authors



esc_sql ›

Since2.8.0
Deprecatedn/a
esc_sql ( $data )
Parameters:
  • (string|array) $data Unescaped data
    Required: Yes
Returns:
  • (string|array) Escaped data
Defined at:
Codex:

Escapes data for use in a MySQL query.

Usually you should prepare queries using wpdb::prepare(). Sometimes, spot-escaping is required or useful. One example is preparing an array for use in an IN clause.



Related Functions: esc_js, esc_url, esc_html, is_ssl, esc_html__

Source

function esc_sql( $data ) {
	global $wpdb;
	return $wpdb->_escape( $data );
}