Re: Change User on a pconnect

From: Date: Mon, 08 Nov 1999 10:18:38 +0000
Subject: Re: Change User on a pconnect
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-12216@lists.php.net to get a copy of this message
Andi Gutmans wrote: > At 11:49 AM 11/6/99 -0500, Rasmus Lerdorf wrote: > >That would work. Then the next question is whether we need to keep the > >username/password stored in the hash up to date. ie. if the user calls > >the user-level mysql_change_user() function, we should probably modify the > >info in the hashed structure to reflect the currently authenticated user > >on that link. > > yes, you'd definitely need to do that. mysql_change_user() would search for > the link by hostname and then update the hashed structure in case the > change_user is successful. mysql_select_db() should do the same and the current database should be part of the hash. The PHPLIB mailing list is full of questions where someone has two DB_Sql objects relating to two different databases which are being connected using the same user/password/host triples. The database objects are kept separate, but PHP produces the same link identifier for both, which is an error. Also, the mysql_select_db documentation should indicate that mysql_query("use ...") is not the correct way to change a database as this would not update the hashed information. Kristian -- Kristian Köhntopp, NetUSE Kommunikationstechnologie GmbH Siemenswall, D-24107 Kiel, Germany, +49 431 386 436 00 Using PHP3? See our web development library at http://phplib.netuse.de/ (We have moved! Update your bookmarks!)

« previous php.dev (#12216) next »