note 42031 added to function.mysql-affected-rows
| From: | GaryW at rn2 dot php dot net | Date: | Fri, 30 Apr 2004 00:59:17 +0000 |
| Subject: | note 42031 added to function.mysql-affected-rows | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69022@lists.php.net to get a copy of this message | ||
I don't know if this behavior is specific to any particular version of MySQL or PHP, but when I
use a sql-based session manager, mysql_affected_rows() returns 0 even when I force the timestamp to
update. For example, both of the following queries will cause mysql_affected_rows() to return 0 if
mydata hasn't changed -- even though the timestamp in the record DOES, in fact, get updated:
UPDATE sessions SET mytimestamp=NULL,mydata='...' WHERE sessionid='...'
UPDATE sessions SET mytimestamp=NOW(),mydata='...' WHERE sessionid='...'
I can't tell if this is a bug in PHP's session handling or something in MySQL. The only
cure seems to be to connect using CLIENT_FOUND_ROWS.
----
Manual Page -- http://www.php.net/manual/en/function.mysql-affected-rows.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42031
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42031&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42031&report=yes
Search -- http://master.php.net/manage/user-notes.php