At 17:27 22-4-2002, Rasmus Lerdorf shared with all of us:

>The proper way to do this in your generalized app would be to either force
>a mysql_select_db on each query to make sure you are talking to the right
>one, or if you prefer do a select database() query to see which is the
>current one.

???
If this is the case, then don't deprecate mysql_db_query.

If keeping track of dbconnection is such a problem, simply hardcode the
database in the query. Then it doesn't matter what db is currently selected.

> > > >     Also, honestly, I do not understand why PHP _forces_ you to
> > > >     reuse the same links. Until the patch/optional parameter the
> > > >     only workaround was to use another username (doh!).

Actually - using different variables, with different hostnames already work.
Ie: localhost / 127.0.0.1 are different. I use it in a forum app, where
registration is in centralized in another database. I can use IP, short
hostname, FQDN, so three at one time if I want to.

Ex:
$con1=mysql_connect("localhost","user","pw");
mysql_select_db("db1", $con1);
$con2=mysql_connect("127.0.0.1", "user","pw");
mysql_select_db("db2", $con2);


Met vriendelijke groeten / With kind regards,

IDG.nl
Melvyn Sopacua
Webmaster


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to