Date: 10/10/00
- Next message: Victor M. Varela: "Re: [phplib] PHPLIB on Linux with MS SQL"
- Previous message: Philip Strnad: "Re: [phplib] Newbie - Is it necessary to pass Session ID in URL?"
- In reply to: daniel: "[phplib] bug report. The active session is saved in the wrong DB"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In netuse.lists.phplib you write:
> This occurs apparently because mysql_query() sends a query to the
>currently active database. In the php documentation, it is written that
>mysql_query() sends a query to the currently active database on the
>server that's associated with the specified link identifier; but it does
>not seem to be the case.
This is exactly what PHP does.
PHP also treats database links as stateless and exchangeable,
and silently returns "old" database links when you open a new
connection using mysql_connect() or mysql_pconnect(), thus
merging two distinct connections with different states into one.
This is a design bug in PHP (and not going to be fixed,
according to the core team).
Your patch works around by setting the database again for each
query.
This does not work with other database interfaces, which have
the same class of problems. In the case of oracle for example,
the same thing is done by PHP - connections are being treated as
having no state and silently merged. In oracle though, state
does not mean "a current database", but "an open uncommitted
transaction", which is far worse. Imagine two different
database objects sharing a common link-id, and one building a
transaction while the other is happily committing stuff.
Kristian
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Victor M. Varela: "Re: [phplib] PHPLIB on Linux with MS SQL"
- Previous message: Philip Strnad: "Re: [phplib] Newbie - Is it necessary to pass Session ID in URL?"
- In reply to: daniel: "[phplib] bug report. The active session is saved in the wrong DB"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

