网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > vBulletin技术交流
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

vBulletin技术交流 主要讨论vBulletin的安装使用、模板风格、插件以及小技巧等。

Reply
 
Thread Tools Display Modes
  #1   IP: 153.99.6.98
Old 2014-03-12, 06:47 AM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default 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..

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
");
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Split Long WordPress Posts into Multiple Pages topvip WordPress 0 2013-05-04 07:24 PM
X-Cart Multiple Input Validation Holes Permit SQL Injection and Cross-Site Scripting topvip X-Cart 0 2009-07-21 10:03 AM
mapping multiple domains into the filespace of a single domain smiling 建站交流 0 2007-08-18 01:25 AM
Question about Adsense and Keywords smiling Google Adsense 0 2006-02-20 03:50 PM

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 11:04 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.