On Jul 16, 2003, "Paulo Neves" claimed that: |Hi, | |How can I set up PHP to work with multiple databases in the same page? |(not tables) | |That's all, | |Thanks | |PN | How do you work with multiple variables in the same page?
<? $database1_link = mysql_connect('localhost', 'user', 'password'); mysql_select_db('database1', $database1_link); $database2_link = mysql_connect('localhost', 'user', 'password'); mysql_select_db('database2', $database2_link); $result1 = mysql_query("SELECT * WHERE 1=1", $database1); $result2 = mysql_query("SELECT * WHERE `foo` = 'banana split'", $database2); require_once ('DB.php'); $dblink=DB::connect("oci8://user:[EMAIL PROTECTED]"); $insert = $dblink->query("INSERT INTO useronline VALUES (3, 4, 'Joe Momma'"); ?> The key is either to use DB.php and define different hooks, or to use the second argument of your _query function. Jeff Harris -- Registered Linux user #304026. "lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import" Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED Responses to this message should conform to RFC 1855. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php