diff --git a/reference/mysql/functions/mysql-affected-rows.xml b/reference/mysql/functions/mysql-affected-rows.xml index 61b8f7b6d4..ccf974fb4e 100644 --- a/reference/mysql/functions/mysql-affected-rows.xml +++ b/reference/mysql/functions/mysql-affected-rows.xml @@ -1,5 +1,5 @@ - + @@ -42,12 +42,15 @@ equal the number of rows matched, only the number of rows that were literally affected by the query. + + REPLACE statement deletes the record with the same primary key first and + then inserts the new record. This function returns the number of deleted + records plus the number of inserted records. + - mysql_affected_rows does not work with - SELECT statements; only on statements which modify records. To - retrieve the number of rows returned by a SELECT, use - mysql_num_rows. + To retrieve the number of rows returned by a SELECT, it is possible to + use also mysql_num_rows. If the last query failed, this function will return -1.