Topic: Using Multiple Databases Simultaneously *connerhd*

Ok, I have a pretty big project Im tackling. I have edited a lot of code for this to fit my needs. Right now im trying to use multiple databases for size control. I have edited common_db.php and added another variable and tried a few other things. However, this code doesnt like the use of two databases. Then problem exists that the last databsae variable in the common_db.php in the dblayer directory is the only one that it uses.  I'm debating on using a ADO database package to manage this. I have setup simple php files to connect to 2 at the same time and it works.

The specific error i get is in functions on the first query it does. It says it cannot find the table, which is true, cause again, its using only the last variable in the common_db.php

Can anyone help with this. I do not have a public accessable way to show you. But I see that connerhd is using 26 different databases if I read correctly. Could you please chime in and spread some light on the subject. THANKS JT

Re: Using Multiple Databases Simultaneously *connerhd*

i'm using 26 databases for mypunbb, but not for one forum, for 450+ forums split up alphabetically, i'm not sure what you mean but i think you only want 1 forum with 2 databases? which doesn't make sense to me...

Re: Using Multiple Databases Simultaneously *connerhd*

NOPE, not one forum with 2 databases. Im just wondering how you set it up and access it(round robin, a dictionary, etc). I have been messing with ways and have a couple I could do, but not as clean as I would like. Its part of an internal solution with high traffic. So thats why it needs seperate db's, that and I have the machines.

If you could help me out and samples would be great. Thanks
metalmile@gmail.com

Re: Using Multiple Databases Simultaneously *connerhd*

i simply set it up

subdomain.mypunbb.com

table prefix = subdomain_

dbname = mypunbb_s (first letter of subdomain)

Re: Using Multiple Databases Simultaneously *connerhd*

And you didnt change the common_db at all. It would be best if I could query this a database and b database from the same page. So I need to have it in the global variables.

Re: Using Multiple Databases Simultaneously *connerhd*

well i never need to access more than one database at once

7

Re: Using Multiple Databases Simultaneously *connerhd*

Man what's the maintenance like on that?  When you upgrade do you have to upgrade all 26 instances of punbb?  I need to do something similar.  I want to have a separate punbb w/ separate database for each City.  Any ideas on how to set that up so that when I upgrade punbb, I don't have to upgrade every single city?

Re: Using Multiple Databases Simultaneously *connerhd*

no i only have 2 instances of punbb, one unedited (apart from a few things specific to mypunbb) and one modded, all the installations share the same fileset, they just use different databases, you need something so that punbb (e.g. in config.php) knows what install its running.

Re: Using Multiple Databases Simultaneously *connerhd*

Rickard, or anyone, is there a way that I can add a global variable and be able to change for something from

$result = $db->query('SELECT....
to
$result = $cm->query('SELECT...


Any help would be excellent