note 77901 rejected from function.msql-affected-rows by nlopess
| From: | nlopess@php.net | Date: | Wed, 19 Sep 2007 21:42:21 +0000 |
| Subject: | note 77901 rejected from function.msql-affected-rows by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-130605@lists.php.net to get a copy of this message | ||
Note Submitter: erikjr at gmail dot com
----
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 ;)