From 34d972684a76c6820e94f873348eeb36d7c39573 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 28 Oct 2004 08:40:54 +0000 Subject: [PATCH] Works with select and replace (bug #30579) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@171438 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mysql/functions/mysql-affected-rows.xml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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.