db_affected_rows

  1. drupal
    1. drupal6 database.mysql.inc
    2. drupal6 database.mysqli.inc
    3. drupal6 database.pgsql.inc
    4. drupal7
Versionen
drupal6 – drupal7 db_affected_rows()

Determine the number of rows changed by the preceding query.

This may not work, actually, without some tricky temp code.

@todo Remove this function when all queries have been ported to db_update().

Verwandte Themen

▾ 2 functions call db_affected_rows()

node_type_update_nodes in modules/node/node.module
Updates all nodes of one type to be of another type.
system_update_6038 in modules/system/system.install
Ensure that "Account" is not used as a Profile category.

Code

includes/database/database.inc, line 2563

<?php
function db_affected_rows() {
  $statement = Database::getConnection()->lastStatement;
  if (!$statement) {
    return 0;
  }
  return $statement->rowCount();
}
?>

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