miz
02-01-2005, 07:46 AM
ok i have 2 dbs on same host
1 is vbulletin and the 2nd is just some info
i need about things
now mysql user have axx to both databases
so i thought ok vbulletin will use $DB_site and for the other info ill user
$predb
so when im doing $Db_site->query($query)
its will run on vbulletin db
and when im doing $predb->query($query) its will run on the other database
sounds simple right ?
so i edited config.php and added $predbname = '';
so i can use it for $predb
also i open init.php to add new db_class
and added this code :
$predb = new DB_Sql_vb;
$predb->appname = 'Pre';
$predb->appshortname = 'pre (' . VB_AREA . ')';
$predb->database = $predbname;
$predb->connect($servername, $dbusername, $dbpassword, $usepconnect);
now my problem is like that
every time server tries to connect to host he connect to db in $predb
so he wont find vbulletin info
now my qustion is if there any way that i can use this method
with out doing mysql_select_db every time i want to use $predb instead of $DB_site ???
help appricated. thanx
MiZ
1 is vbulletin and the 2nd is just some info
i need about things
now mysql user have axx to both databases
so i thought ok vbulletin will use $DB_site and for the other info ill user
$predb
so when im doing $Db_site->query($query)
its will run on vbulletin db
and when im doing $predb->query($query) its will run on the other database
sounds simple right ?
so i edited config.php and added $predbname = '';
so i can use it for $predb
also i open init.php to add new db_class
and added this code :
$predb = new DB_Sql_vb;
$predb->appname = 'Pre';
$predb->appshortname = 'pre (' . VB_AREA . ')';
$predb->database = $predbname;
$predb->connect($servername, $dbusername, $dbpassword, $usepconnect);
now my problem is like that
every time server tries to connect to host he connect to db in $predb
so he wont find vbulletin info
now my qustion is if there any way that i can use this method
with out doing mysql_select_db every time i want to use $predb instead of $DB_site ???
help appricated. thanx
MiZ