hello everybody
I'm trying to connect to 2 databases on the same server at the same time but its not happening. I have this
DEFINE ('DB_USER', 'root');
DEFINE ('DB_PASS', '***');
DEFINE ('DB_HOST', '127.0.0.1');
DEFINE ('DB_NAME', 'name');
DEFINE ('DB_NAME2', 'nom');
$con = mysql_connect(DB_HOST, DB_USER, DB_PASS) OR die('couldn\'t connect to mysql');
mysql_select_db(DB_NAME) OR die('couldn\'t connect to the database');
$con2 = mysql_connect(DB_HOST, DB_USER, DB_PASS) OR die('couldn\'t connect to mysql');
mysql_select_db(DB_NAME2) OR die('couldn\'t connect to the database');
however it seems that whenever i run an sql query it uses $con2 by default. I thought maybe defining 2 different database names would work but no.
I'm sure you guys have seen this many times but i really have no clue as to how i would get this to happen, apart from adding the tables from one database to the other and just using the one connection.
Any help?