ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:affected_rows

This is an old revision of the document!


affected_rows

Syntax
 mixed affected_rows()

Description

The function affected_rows() returns the number of rows affected (add/change/delete) by the last SQL statement executed, or false if the database does not support the function or the statement is not an update. See the driver documentation for support. Most multi-user databases support the command.

Usage

/*
 * connection assumed
 */
$db->Execute('DELETE FROM act WHERE actno = 20');
 
print $db->affected_rows();
/*
 * Returns 1
 */
 
$db->Execute('SELECT FROM act');
print $db->affected_rows();
/*
 * Returns false
 */
v5/reference/connection/affected_rows.1452980180.txt.gz · Last modified: 2017/04/21 11:37 (external edit)