Use Drupal database placeholders instead of concatenating SQL

Reviewed Drupal Knowledge trusted knowledge, reviewed by a human against authoritative sources

A human reviewed this against registered authoritative sources. It states something about Drupal, not about any one project.

Drupal secure-code documentation says data must never be concatenated directly into SQL queries and directs developers to use proper argument substitution, select queries, escapeLike() for LIKE values, and fixed operator choices.

Record drupal.security.database-query-parameterization

What this is

What is this
trusted knowledge, reviewed by a human against authoritative sources: Use Drupal database placeholders instead of concatenating SQL
Why it exists
A human reviewed authoritative Drupal sources and recorded this as trusted knowledge.
What makes it authoritative
A human reviewed this against registered authoritative sources. It states something about Drupal, not about any one project.
Project scope
Nothing: this record is about Drupal, not about any one project.
Recommended next step
Read the record's own actions and checks.
Was anything changed
No. Querying Drupal Knowledge changes nothing.

What is not known

  • Nothing was left unstated by this record.

What the record states

Values as recorded. Blank means the record did not state one.
Domainssecurity, database, api
Kindsecurity-guidance
Version applicabilitydrupal_core: [{'constraint': 'current-documented-secure-code-guidance', 'notes': 'This record reflects current Drupal secure-code guidance for database query construction.', 'status': 'applicable'}]

Provenance

This record's authority is internal to Drupal Knowledge; no external source snapshot stands behind it.

Only relationships the canonical records already declare. Nothing here is inferred.

Derived from source