Closed Thread Icon

Topic awaiting preservation: Multible Database Access in PHP (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=24293" title="Pages that link to Topic awaiting preservation: Multible Database Access in PHP (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Multible Database Access in PHP <span class="small">(Page 1 of 1)</span>\

 
shalvi
Nervous Wreck (II) Inmate

From:
Insane since: Oct 2003

posted posted 12-04-2004 09:25

$dbh=mysql_connect ("localhost", "root", "triadpass") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("connectbdsms");
mysql_select_db ("billing");


$result=mysql_query("SELECT userid FROM account WHERE userid='$uid' ");

$bill=mysql_query("SELECT * FROM billinginfo ");

---------------------------------------------------------------------------------------
I want to access 2 database in one database server and have run different queries in 2 database (pls see above code) but for some reason iit's not working ....actually how to distinguish the 2 database query ....i can not get the idea....

any Help?

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 12-04-2004 11:43

you'll either need to create two different connections to your database, which will result in two hlinks that you'll have to pass to the query every time, or select your database right before your query, every time you need another database.

shalvi
Nervous Wreck (II) Inmate

From:
Insane since: Oct 2003

posted posted 12-09-2004 07:12

thnx dude!! it becomes the solution :-)

« BackwardsOnwards »

Show Forum Drop Down Menu