Page 1 of 1
Working on 2 MySQL databases within 1 .PHP file
Posted: Tue Feb 13, 2007 4:17 am
by impulse()
Would this be achieved by using mysql_select_db("db-A") before the code that's going to use db-a and then mysql_select_db("db-B") before the code that's going to be accessing db-B ?
Regards,
Posted: Tue Feb 13, 2007 4:57 am
by phpdevuk
can be achieved that way, or by declaring two different variables pointing to the database connections in the format of
Code: Select all
$link = mysql_connect('example.com:3307', 'mysql_user', 'mysql_password');
$link2 = mysql_connect('example2.com:3307', 'mysql_user', 'mysql_password');
its all on the manual page at
http://uk2.php.net/manual/en/function.mysql-connect.php
Posted: Tue Feb 13, 2007 5:28 am
by impulse()
Cheers Mr Threepwood
