[phplib] Re: Migrating PHPLIB to PHP4/MySql 3.23 From: Matthew Leingang (leingang <email protected>)
Date: 09/26/00

Hi again,

Please disregard my desperation; I think I fixed it.

FWIW: The problem was that I was calling page_close twice on the same
page (when I first wrote the file I knew less about how authentication
worked and that's why). Two calls to page_close in the same (according to
unix timestamp) second will produce precisely this error. The first time,
the record will be updated, but the second time, the record has already
been updated (even the timestamp field 'changed') and thus affected_rows()
is 0.

I guess I had never seen this before because the database calls between
the two calls to page_close bogged it down enough so that the time was
always different. Hoo-ray for the faster server; it made me a better
programmer. :-)

Cheers,
Matt

----------------------------------------------------------------
Matthew Leingang http://www.math.rutgers.edu/
Rutgers University leingang <email protected>
Department of Mathematics "This signature needs no quote."

On Tue, 26 Sep 2000, Matthew Leingang wrote:

> Hi Folks,
>
> My single problem in moving my site to a new server with PHP4 and MySql
> 3.23 remains. I get a MySQL error when executing page_close(), because it
> tries to insert the record when it already exists. This error only occurs
> on the home page to the site, and not always.
>
> I read the source code in ct_sql.inc for ac_store(), and it seems that the
> only thing that could generate this error if rows_affected() returns 0
> even though the record exists and has been updated successsfully.
> Otherwise, the insert code should not even be run.
>
> Has anyone run into this particular problem before?
>
> TIA for all your help.
>
> --Matthew Leingang
>
> ----------------------------------------------------------------
> Matthew Leingang http://www.math.rutgers.edu/
> Rutgers University leingang <email protected>
> Department of Mathematics "This signature needs no quote."
>
>

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