Firebird 2.0
PHP5 Programming
Manual

FBIRD_AFFECTED_ROWS

Purpose

Use the fbird_affected_rows function to retrieve the number of rows that were affected by the last DML statement.

Syntax

<affected_rows> ::=
   fbird_affected_rows( link_id )


Element 
Type
Description
link_id
resource
Transaction handle or connection handle
<return>
int
Number of affected rows

Semantics

This function returns the number of rows that were affected by the last DML statement (select, insert, update, delete) that was executed from within the transaction context specified by link_identifier. If link_identifier is a connection resource, its default transaction is used.

Example

The below example prints the number of rows in table 'tblname':

$host = 'localhost:/path/to/your.fdb';

$dbh = fbird_connect($host, $username, $password);
$stmt = 'SELECT * FROM tblname';
$sth = fbird_query($dbh, $stmt);
echo fbird_affected_rows($dbh);
fbird_free_result($sth);
fbird_close($dbh);



See also

fbird_query, fbird_execute


previous page goto index next page

Legal information