PDA

View Full Version : Using $DB object on other databases than vB?


RoutineX
03-03-2007, 01:49 PM
I'm trying to write my first product in vB and had some problems with the database connectivity.

I have some data on another database that I don't want to insert into the vB database.

Shouldn't it be enough to give select access to the other database on the vB user and than do a query like:

$somevar = $db->query_first("SELECT blabla FROM unixusername_otherdb.table");

I guess I could install mysql 5 and create a view, but was wondering if there was any other ways.

Thanks =)

Cap'n Steve
03-05-2007, 01:01 AM
I think the database connection can only deal with one database, although it looks like you know just as much about MySQL as me.

Adrian Schneider
03-05-2007, 01:11 AM
You could create a second database object for your other database.

version2
06-03-2007, 06:50 PM
You could create a second database object for your other database.
How would one do that with VB's database class?

Eikinskjaldi
06-03-2007, 10:35 PM
Whilst you could create a second object, you were correct the first time.

Shouldn't it be enough to give select access to the other database on the vB user and than do a query like:

$somevar = $db->query_first("SELECT blabla FROM unixusername_otherdb.table");



will work. You can also join across databases.