note 2854 deleted from mysql_affected_rows by danbeck
| From: | danbeck@php.net | Date: | Thu, 08 Mar 2001 21:16:08 +0000 |
| Subject: | note 2854 deleted from mysql_affected_rows by danbeck | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-12065@lists.php.net to get a copy of this message | ||
This might seem obvious to some, but this returns the number of rows that have literally been
*affected* by the SQL command; i.e., it will return zero if it matches rows but does not change
them. For example, if you use an UPDATE command and it matches a record but no values change, this
will return zero. If you are using a zero return as an indication of error, this will not make a
sensible match for your logic! (You wouldn't programmatically update equal values, but a user
might 'update' a record with the values that already existed, which should probably *not*
be considered an error condition.)