|
PHP5中文手册
mysqli_affected_rowsmysqli->affected_rows(PHP 5) mysqli->affected_rows — Gets the number of affected rows in a previous MySQL operation 说明Procedural style:
int mysqli_affected_rows
( mysqli $link
)
Object oriented style (property): mysqli
int$affected_rows;
Returns the number of rows affected by the last INSERT, UPDATE, REPLACE or DELETE query. For SELECT statements mysqli_affected_rows() works like mysqli_num_rows(). 返回值An integer greater than zero indicates the number of rows affected or retrieved. Zero indicates that no records where updated for an UPDATE statement, no rows matched the WHERE clause in the query or that no query has yet been executed. -1 indicates that the query returned an error.
范例Example#1 Object oriented style
<?php Example#2 Procedural style
<?php 上例将输出:
|