execute

  1. drupal
    1. drupal7
Versionen
drupal7 public InsertQuery_mysql::execute()

Verwandte Themen

Code

includes/database/mysql/query.inc, line 17

<?php
public function execute() {

  // Confirm that the user did not try to specify an identical
  //  field and default field.
  if (array_intersect($this->insertFields, $this->defaultFields)) {
    throw new PDOException('You may not specify the same field to have a value and a schema-default value.');
  }

  if (count($this->insertFields) + count($this->defaultFields) == 0) {
    return NULL;
  }

  // Don't execute query without values.
  if (!isset($this->insertValues[0]) && count($this->insertFields) > 0) {
    return NULL;
  }

  $last_insert_id = 0;

  $max_placeholder = 0;
  $values = array();
  foreach ($this->insertValues as $insert_values) {
    foreach ($insert_values as $value) {
      $values[':db_insert_placeholder_' . $max_placeholder++] = $value;
    }
  }

  $last_insert_id = $this->connection->query((string) $this, $values, $this->queryOptions);

  // Re-initialize the values array so that we can re-use this query.
  $this->insertValues = array();

  return $last_insert_id;
}
?>

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