I currently run vbulletin forums with other services linked in to the same database. But it has started to become really hard to manage.. around over 200+ tables..
I was wondering if there was a way I could put my services into another database and still use the plug-in system to have them linked into the forums for all the connections and vars. My current system I have one database with my services in tables of one database..
Here is the method.
As long as the MySQL user for vBulletin has access to the other database, we can use the standard MySQL "database.table" syntax.
Code:
SELECT *
FROM database1.tableA
Here is what we use:
This is the current code I use to bring over vars from other tables in the same database.
Code:
$uservar = $vbulletin->db->query_first("
SELECT *
FROM `table_servusers`
WHERE `username` = '" . $vbulletin->userinfo['username'] . "'
LIMIT 1
");
This is the changes:
Code:
$uservar = $vbulletin->db->query_first("
SELECT *
FROM `mysite_database2.table_servusers` .
WHERE `username` = '" . $vbulletin->userinfo['username'] . "'
LIMIT 1
");