[phplib] Explanation: PHPLib 7.2b, PHP 4.0, MySQL 3.23 and duplicate entry in active_sessions From: Loh Siu Yin (siuyin1 <email protected>)
Date: 10/26/00

This relates to duplicate sessions bug that appears intermittently. Firstly,
thanks to the list contributors that pointed me to ac_store() in ct_sql.inc.

ac_store in ct_sql relies on a update query ( $uquery ) to check if there is
an existing session. This in turn relies on the mysql_affected_rows()
function

However I believe the behavior of mysql_affected_rows has CHANGED in PHP
4.0/MySQL 3.23. mysql_affected_rows only return rows that have ACTUALLY
changed and cannot be used reliably to detect the presence of a row. $now only
has a resolution to 1second thus the row may not actually be updated if the
page is quickly reloaded/revisited.

The patches fixing the problem rely on select and using num_rows() to report
the presence of the sessions row.

Thus ac_store needs to be updated to not use affected_rows and to use
num_rows() instead.

SiuYin Loh

____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at http://home.netscape.com/webmail

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>