theferf
12-04-2006, 11:16 PM
I am in the process of developing a plugin to access data from a DB outside of vBulletin's database, yet still on the same mySQL server. Normally, this can be done in mySQL by formatting the query as follows:
SELECT table1.foo FROM db1.table1 WHERE table1.foo='bar';
Where db1 is the name of the external database (on the same DB server). When I attmept this in my plugin I end up with:
Database error in vBulletin 3.6.2:
Invalid SQL:
SELECT table1.foo FROM db1.table1 where table1.foo='bar';
MySQL Error : Table 'db1.table1' doesn't exist
Error Number : 1146
Of course, I've renamed the DB and table in this example to protect the innocent. ;) The DB and the table do exist, but for some reason the $db->query() usage in VB won't let me do this. I have used the very same method in PHP's native mysql_query() many, many times. Is there something in the VB database class that prevents this?
SELECT table1.foo FROM db1.table1 WHERE table1.foo='bar';
Where db1 is the name of the external database (on the same DB server). When I attmept this in my plugin I end up with:
Database error in vBulletin 3.6.2:
Invalid SQL:
SELECT table1.foo FROM db1.table1 where table1.foo='bar';
MySQL Error : Table 'db1.table1' doesn't exist
Error Number : 1146
Of course, I've renamed the DB and table in this example to protect the innocent. ;) The DB and the table do exist, but for some reason the $db->query() usage in VB won't let me do this. I have used the very same method in PHP's native mysql_query() many, many times. Is there something in the VB database class that prevents this?