prepareQuery

  1. drupal
    1. drupal7
Versionen
drupal7 protected DatabaseConnection::prepareQuery($query, $cache = TRUE)

Prepare a query string and return the prepared statement.

This method caches prepared statements, reusing them when possible. It also prefixes tables names enclosed in curly-braces.

Übergabeparameter

$query The query string as SQL, with curly-braces surrounding the table names.

$cache Whether or not to cache the prepared statement for later reuse in this same request. Usually we want to, but queries that require preprocessing cannot be safely cached.

Rückgabewert

A PDO prepared statement ready for its execute() method.

Verwandte Themen

Code

includes/database/database.inc, line 454

<?php
protected function prepareQuery($query, $cache = TRUE) {
  $query = $this->prefixTables($query);
  if (empty($this->preparedStatements[$query])) {
    // Call PDO::prepare.
    $this->preparedStatements[$query] = parent::prepare($query);
  }
  return $this->preparedStatements[$query];
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen