From 8e4ba0e729c4c5b26753cb6319b10b1a88a63e3f Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Fri, 1 Jun 2012 07:01:17 +0000 Subject: [PATCH] Documented PHP Bug #60770 -- Return value for 'INSERT ... ON DUPLICATE KEY UPDATE' queries. Note stolen from david_colter at me dot com. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@325920 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mysql/functions/mysql-affected-rows.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/mysql/functions/mysql-affected-rows.xml b/reference/mysql/functions/mysql-affected-rows.xml index c78a8aced9..d38dec2866 100644 --- a/reference/mysql/functions/mysql-affected-rows.xml +++ b/reference/mysql/functions/mysql-affected-rows.xml @@ -50,6 +50,11 @@ and then inserts the new record. This function returns the number of deleted records plus the number of inserted records. + + In the case of "INSERT ... ON DUPLICATE KEY UPDATE" queries, the + return value will be 1 if an insert was performed, + or 2 for an update of an existing row. +