sesam_affected_rows

(PHP 3 CVS only)

sesam_affected_rows -- Get number of rows affected by an immediate query

Description

int sesam_affected_rows ( string result_id )

Gets the number of rows affected by an immediate query.

The sesam_affected_rows() function can only return useful values when used in combination with "immediate" SQL statements (updating operations like INSERT, UPDATE and DELETE) because SESAM does not deliver any "affected rows" information for "select type" queries.

Parameters

result_id

A valid result id returned by sesam_query().

Return Values

Returns the number of rows affected by a query associated with result_id.

Examples

Example 1. sesam_affected_rows() example

<?php
$result
= sesam_execimm("DELETE FROM PHONE WHERE LASTNAME = '" . strtoupper($name) . "'");
if (!
$result) {
    
/* ... error ... */
}
echo
sesam_affected_rows($result).
    
" entries with last name " . $name . " deleted.\n";
?>


Follow phpf1 on Twitter




F1 Site Family
AJAX F1
HTML F1
Java F1
JavaScript F1
PHP F1

Total time: 0.0395