View Single Post
Old Apr 10, 2012, 10:46 AM   #6
Aquinus
3500 Posts
 
Aquinus's Avatar
 
Join Date: Jan 2012
Location: Dover, New Hampshire, USA
Posts: 4,277 (8.84/day)
Thanks: 1,284
Thanked 1,336 Times in 992 Posts

System Specs

adodb makes a good DB abstraction layer.
http://adodb.sourceforge.net/

PHP Code:
include('/path/to/adodb.inc.php');
$DB NewADOConnection('mysql');
$DB->Connect($server$user$pwd$db); 
Then if you're working with multiple databases, just make an array or object of NewADOConnection members. It might be wise to make $DB global as well.

PHP Code:
include('/path/to/adodb.inc.php');
global 
$DB;
$DB = new stdClass;
$DB->foo NewADOConnection('mysql');
$DB->bar NewADOConnection('mysql');
$DB->foo->Connect($server$user$pwd$db);
$DB->bar->Connect($server$user$pwd$someotherdb); 
__________________
MyHeat

Last edited by Aquinus; Apr 10, 2012 at 12:03 PM.
Aquinus is offline  
Crunching for Team TPU
Reply With Quote
The Following 3 Users Say Thank You to Aquinus For This Useful Post: