Log in

View Full Version : Anyone able to shed some light on this?


LeeCHeSSS
08-26-2003, 08:04 AM
As most of you know, vb uses an object for the database connection ($DB_site).

I'm trying to create a second such object ($DB_gamesite) so that I can use vb's functions to manipulate another database.

In global.php I added
$DB_gamesite=new DB_Sql_vb;

$DB_gamesite->appname='EoCGame';
$DB_gamesite->appshortname='EoC';
$DB_gamesite->database='EoCGame';
$DB_gamesite->server=$servername;
$DB_gamesite->user=$dbusername;
$DB_gamesite->password=$dbpassword;

$DB_gamesite->connect();

Yet, somehow whenever I try to do a query using this new object, it queries the database from the original object (EoCBoard instead of EoCGame). How on earth is that possible?

Floris
08-26-2003, 09:35 AM
Because it is incomplete ? The init db is bigger then just this code.

LeeCHeSSS
08-26-2003, 10:01 AM
No, it is not incomplete. Should've said it's vb2.

In global.php the same lines (minus "game" ofcourse) are used to setup the $DB_site object...

Dean C
08-26-2003, 10:31 AM
It's not that easy.

Duplicate the class and rename it :)

- miSt

Dean C
08-26-2003, 10:39 AM
I forgot to say you need to change a few of the properties as well as they are referring to the database defined in config.php :)

- miSt