db_affected_rows()
drupal/includes/database/database.inc, line 2365
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().
| Name | Description |
|---|---|
| Database abstraction layer | Allow the use of different database servers using the same code base. |
function db_affected_rows() {
$statement = Database::getActiveConnection()->lastStatement;
if (!$statement) {
return 0;
}
return $statement->rowCount();
}