note 14599 added to function.mysql-affected-rows.php

From: Date: Mon, 06 Aug 2001 03:34:09 +0000
Subject: note 14599 added to function.mysql-affected-rows.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-16360@lists.php.net to get a copy of this message
mysql_affected_rows() fails with some automatic updates. An example from the PHP Black Book is that of session records updated by automatic timestamps. When you maintain the session valid time via a timestamp and use some databases including MySQL, then update the session record, the automatic timestamp update will not count as an update in mysql_affected_rows(). You have to manually update the timestamp field. In MySQL that is achieved by setting the field to nulls. If your time field is named updated, you have to include set updated = null Other databases require appropriate tricks and you will have to test stored procedures in your database to see if their updates count in mysql_affected_rows(). http://www.php.net/manual/en/function.mysql-affected-rows.php

« previous php.notes (#16360) next »