My issue is....
I have 2 databases that I am connecting to.
At the beginning of my script, I open the first db:
if( !($dblink = mysql_connect($dbhostname, $dbusername, $dbpassword)) )
{
trigger_error("Line: ".__LINE__."\nFile: ".__FILE__);
}
if( !(mysql_select_db($dbdatabaseName, $dblink)) )
{
trigger_error("Line: ".__LINE__."\nFile: ".__FILE__);
}
I run some select statements and whatnot, and this works fine.
Next, I open a second connection to another database:
if( !($dblink2 = mysql_connect($dbhostname2, $dbusername2, $dbpassword2)) )
{
trigger_error("Line: ".__LINE__."\nFile: ".__FILE__);
}
if( !(mysql_select_db($dbdatabaseName2, $dblink2)) )
{
trigger_error("Line: ".__LINE__."\nFile: ".__FILE__);
}
I run my select statements using mysql_query($sql, $dblink2). All works fine so far.
Next, I mysql_close($dblink2)
Problem: I cannot query my first, and still open, database. For some reason, it acts like I severed all connections. I have tried using mysql_query($sql) and also mysql_query($sql, $dblink).
If I don't close the $dblink2, the DB will continue to try to access that database ALL THE TIME, no matter what I specify.
Is there something I am doing wrong? Plz help. Thanks.
I am not sure what I have to do to make sure