The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
multiple databases question
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.. Thanks for reading, looking for a clean way to do this like a plugin on start or something. Thank you for your time, c4smok |
#2
|
||||
|
||||
As long as the MySQL user for vBulletin has access to the other database, you can use the standard MySQL "database.table" syntax.
[sql]SELECT * FROM database1.tableA[/sql] |
#3
|
|||
|
|||
I seem to be getting a database error for the forum system when I try to use that.
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 "); Code:
$uservar = $vbulletin->db->query_first(" SELECT * FROM `mysite_database2.table_servusers` WHERE `username` = '" . $vbulletin->userinfo['username'] . "' LIMIT 1 "); Code:
Invalid SQL: SELECT * FROM `mysite_database2.table_servusers` WHERE `username` = 'c4smok' LIMIT 1; MySQL Error : Incorrect table name 'mysite_database2.table_servusers Error Number : 1103 c4smok |
#4
|
|||
|
|||
Try mysite_database2.table_servusers with the `.
|
#5
|
|||
|
|||
its working =)
your great thanks, c4 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|