note 77901 added to function.msql-affected-rows
| From: | erikjr at gmail dot com | Date: | Wed, 19 Sep 2007 08:49:14 +0000 |
| Subject: | note 77901 added to function.msql-affected-rows | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130587@lists.php.net to get a copy of this message | ||
Keep in mind that unlike it's PostgreSQL counterpart (and I believe all others as well), the
following query will return ALWAYS return 0 rows affected:
<?php
UPDATE table
SET table.field = table.field
WHERE 1
?>
Somehow, if you don't change any of the values, it's not counted as an update. This can be
rather confusing if you, for example, try to increase an item by an integer and the integer happens
to be 1, or if someone fills out a new name that is the same as the old name...
If anyone knows a way around this, do please share ;)
----
Server IP: 85.12.26.134
Probable Submitter: 193.173.146.43
----
Manual Page -- http://www.php.net/manual/en/function.msql-affected-rows.php
Edit -- https://master.php.net/note/edit/77901
Del: integrated -- https://master.php.net/note/delete/77901/integrated
Del: useless -- https://master.php.net/note/delete/77901/useless
Del: bad code -- https://master.php.net/note/delete/77901/bad+code
Del: spam -- https://master.php.net/note/delete/77901/spam
Del: non-english -- https://master.php.net/note/delete/77901/non-english
Del: in docs -- https://master.php.net/note/delete/77901/in+docs
Del: other reasons-- https://master.php.net/note/delete/77901
Reject -- https://master.php.net/note/reject/77901
Search -- https://master.php.net/manage/user-notes.php