RE: [PHPLIB] Problem with Sessions From: nathan r. hruby (nhruby <email protected>)
Date: 11/29/99

Perhaps I'm wrong (I'm sure someone here will probably tell me if I am :)

I remember that php3 has issues with mutiple queries to diffrent databases
on the same server, as in, the pointer never gets reset back. This
appears to a php3 bug (or feature, I guess it depends on who you are :).

One workaround I think was to use a SELECT startment that refrenced
databasename.tablename, the catch is that you have to do this to ALL
select statements. (Another was to open an entirely new connection to the
server, which is messy)

ie, instead of
SELECT * FROM foo WHERE bar=$bat
try
SELECT * FROM mydatabase.foo WHERE bar=$bat

don't forget to also set the pointer back to the phplib database when
you're done. You can do this by issuing another call that refrences
phplibdb.user_data

You may need to extend the db_sql(?) class to do this in a phplib sort of
way.

HTH

-n

ps.. alternitivley you could include the phplib tables into the dbase
you're already working with, hence requiring only one database connection
for everything. Not sure if you care do do that...

On Mon, 29 Nov 1999, Stephen Bolinger wrote:

> I found that if I issued the page_close() command prior to opening and
> interacting with the database that the session variable would increment.
> So, is there any way to open a session, interact with a database via the
> PHPLIB database abstraction, then close the session?
>
> -Stephen Bolinger
>
>
> Stephen Bolinger wrote:
>
> > Hi. I'm trying to integrate session management into my site. I got
> PHPLIB,
> > installed it and got the demo working fine.
> >
> > I am using PHPLIB's database abstraction to interact with a MySQL
> database.
> > Here's where I've run into trouble:
> >
> > I took the PHPLIB sample index.php3 and added some database connectivity
> to
> > it. It displays everything properly out of the database, but the "s"
> > variable does not increment. I've narrowed it down to the "$db->query"
> > method.
> >
> > If I leave in the creation of the $db object but comment out the
> $db->query,
> > the "s" variable increments. As soon as I put the query back in, the
> number
> > stays the same. Any ideas?
> >
> > -Stephen Bolinger
> >
>
> -
> PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
> To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
> the body, not the subject, of your message.
>

-----------------------------------------------------------------------------
nathan hruby
nhruby <email protected>
Linux: Because rebooting is for hardware upgrades.
-----------------------------------------------------------------------------

-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.