Page 1 of 1

working with 2 databases

Posted: Sat Dec 18, 2010 2:37 pm
by mshperling770
B"H

hello everyone! in the project i am working on on some pages i need to take data from one database and sometimes from another so i have some flag variable that switches between them. The problem starts that there are certain places i need to retrieve data from 2 databases to the same page.

i've given link-identifier for every connection:

Code: Select all

$hebdb = mysql_connect("localhost","user","pass",true);

Code: Select all

$link = mysql_connect("localhost","user","pass",true);
and every time i use mysql_query i put this link:

Code: Select all

$rItemsCount = mysql_query($qItemsCount,$hebdb);
in but it tells me:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in...

any help would be very much appriciated. Thanks. :?

Re: working with 2 databases

Posted: Sat Dec 18, 2010 5:29 pm
by Apollo
Did you select a database for either connection? (using mysql_select_db)