I have 2 functions, the function get_user_info() which connects to a db called 'users', and another, called print_info() which connects to a db called 'blah'. I call get_user_info() inside print_info(), so it can retrieve the information. They connect to 2 different databases and make 2 different connections, i use another function to connect to the db which is called connect_db($dbidhere). When I call get_user_info() it like cancels out the other connection, and I have to reconnect to the db called 'blah' after I call get_user_info(). Is there a way to have a private connection just for inside a function and doesnt cancel out the other connection?
function get_user_info() {
connect_db($db1);
$query = 'blah blah';
$row = mysql_fetch_array($query);
echo $row['cool'];
}
function print_info() {
connect_db($db2);
$query = 'blah blah again';
get_user_info(); // Here is where it cancels out the 'connect_db($db2)' and replaces it with get_user_info connection
}