[prev in list] [next in list] [prev in thread] [next in thread]
List: phplib
Subject: RE: [phplib] Problem with sessions, MySQL insert error.
From: http://marc.theaimsgroup.com/?a=96373573700001&w=2&r=1
Date: 2000-08-03 12:07:41
[Download message RAW]
This error did the rounds (again) last week on the list. 7.2c was supposed
to
fix this, but I (like you) still had the problem. But only with MySQL 3.23,
not MySQL 3.22.
I made the following two changes to ct_sql.inc in the 7.2c distribution:
line 113: from
&& $this->db->f(1) == 0
to
&& $this->db->nf() == 0
This by itself, instead of fixing it, stopped logging in working at all!
changing line 85 from:
$squery = sprintf("select count(*) from %s where val='%s' and
changed='%s' and sid=
'%s' and name='%s'",
to
$squery = sprintf("select * from %s where val='%s' and changed='%s' and
sid=
'%s' and name='%s'",
as well as the line 113 change fixed the problem completely. I have no idea
why the line 113 change (which seemed correct to me by itself) stuffed up so
badly, and why count(*) doesn't seem to return any rows - at least in MySQL
3.23.8
Anyone else have any insights into that behaviour?
PJH
> -----Original Message-----
> From: francis bouchard [mailto:fbouchard@semantix.com]
> Sent: Thursday, August 03, 2000 12:03 AM
> To: Jacob Bower; phplib@lists.netuse.de
> Subject: Re: [phplib] Problem with sessions, MySQL insert error.
>
>
> I have the axact same problem and still not have the answer! I posted
> yesterday
> You can serach header for page_close()
>
> If I find anything i'll let you know
>
> ----- Original Message -----
> From: Jacob Bower <jake.b@ision.net.uk>
> To: <phplib@lists.netuse.de>
> Sent: Thursday, August 03, 2000 12:02 AM
> Subject: [phplib] Problem with sessions, MySQL insert error.
>
>
> Originally I was using PHP4 for its built in sessioning capabilities,
> however I found that PHP4 appears to have a few bugs that cause
> it to corupt
> data when interfacing with MS SQL using freetds. So now I am
> using PHP3 and
> PHPLIB just for sessioning.
>
> However I am randomly recieveing these error messages at the bottom of my
> pages when I call page_close()
>
> >>Begin error<<
>
> Database error: Invalid SQL: insert into active_sessions ( sid, name, val,
> changed ) values ('bbdf5649e59b6d4c53d5187000fa378b', 'session',
> 'c2Vzc2lvbjokdGhpcy0+aW4gPSAnJzsgJHRoaXMtPnB0ID0gYXJyYXkoKTsgJHRoa
> XMtPnB0Wyd
> QSFBfQVVUSF9VU0VSJ10gPSAnMSc7ICR0aGlzLT5wdFsnUEhQX0FVVEhfUFcnXSA9I
> CcxJzsgJEd
> MT0JBTFNbJ1BIUF9BVVRIX1VTRVInXSA9ICdqYWtlJzsgJEdMT0JBTFNbJ1BIUF9BV
> VRIX1BXJ10
> gPSAnbm9uZSc7IA==', '20000802095432')
> MySQL Error: 1022 (Can't write, duplicate key in table 'active_sessions')
> Session halted.
>
> >>end error<<
>
> I have tried deleteing all the records in the 'active_sessions'
> table, but I
> still seem to get this error fairly frequently. Please can someone suggest
> what I can do.
>
> I am using PHPLIB-7.2c, PHP 3.0.16 compile as a DSO for apache 1.3.12.
>
> Any help appreciated.
>
> - Jake
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: phplib-unsubscribe@lists.netuse.de
> For additional commands, e-mail: phplib-help@lists.netuse.de
>
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe@lists.netuse.de
For additional commands, e-mail: phplib-help@lists.netuse.de
[prev in list] [next in list] [prev in thread] [next in thread]
Log
in / Log out
About MARC
We're
Hiring!
Want
to add a list? Tell us about
it.
The AIMS
Group