note 76135 added to function.mysql-affected-rows

From: Date: Mon, 02 Jul 2007 10:21:04 +0000
Subject: note 76135 added to function.mysql-affected-rows
Groups: php.notes 
Request: Send a blank email to php-notes+get-128153@lists.php.net to get a copy of this message
If you use "INSERT INTO ... ON DUPLICATE KEY UPDATE" syntax, mysql_affected_rows() will return you 2 if the UPDATE was made (just as it does with the "REPLACE INTO" syntax) and 1 if the INSERT was. So if you use one SQL request to insert several rows at a time, and some are inserted, some are just updated, you won't get the real count. ---- Server IP: 217.174.196.197 Probable Submitter: 82.228.190.214 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-affected-rows.php Edit -- https://master.php.net/note/edit/76135 Del: integrated -- https://master.php.net/note/delete/76135/integrated Del: useless -- https://master.php.net/note/delete/76135/useless Del: bad code -- https://master.php.net/note/delete/76135/bad+code Del: spam -- https://master.php.net/note/delete/76135/spam Del: non-english -- https://master.php.net/note/delete/76135/non-english Del: in docs -- https://master.php.net/note/delete/76135/in+docs Del: other reasons-- https://master.php.net/note/delete/76135 Reject -- https://master.php.net/note/reject/76135 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#128153) next »