The Arcive of vBulletin Modifications Site. |
|
Multiple instances of vB's DBwrapper... Details »»
|
|||||||||||||||||||||||||
Hey all. I'm making something, and I'm trying to use multiple instances of vBulletin's DBwrapper. But when I do, it starts freaking out.
I'm trying to connect to two databases at once. But I find that when I create a new instance, all instances of the DBwrapper use the most recently created instance in the script. If you didn't understand that, it's my fault ![]() I'm trying to have two DBwrappers open. It doesn't work. I configure each for the right DB, but each instance ($DB_site and $mySQL) are the same. Any of PHP whizes know why this is? I know a lot of PHP, but I can't figure out why this is... BTW...If you're wondering why I want to connect to multiple DBs, one DB = vBulletin, the other DB = my Website. Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
It's because mysql_query() queries the last used database, so whenever you create $mySQL the selected database changes in $DB_site as well. I think...
Try redefining the DB_Sql_vb class to use mysql_db_query() in the query() method instead of just mysql_query(). As the first parameter for mysql_db_query() use $this->dbname (or whatever the variable is). Good luck.
|
![]() |
|
|