[support] using two different database type

Earnie Boyd earnie at users.sourceforge.net
Wed Jul 30 13:52:27 UTC 2008


Quoting Ámon Tamás <amont at 5net.hu>:

> Hello,
>
> I like to use two database, a postgresql and a mysqli in my module. My
> settings.php looks like this:
>
> $db_url['default'] = 'mysqli://user:pass@localhost:3370/allathletics';
> $db_url['atleta'] = 'pgsql://user:pass@192.168.2.104/cds_atletabackup';
>
> But when I try the
>
> db_set_active('atleta');
>
> I get the
>
> Fatal error: Cannot redeclare db_status_report() (previously declared in
> /var/www/mysite/includes/database.mysqli.inc:23) in
> /var/www/demo.internetstudio.hu/allathletics/web/includes/database.pgsql.inc
> on line 33
>
> Is there a solution for it, or I must to use two same database type?
>

The only solution is to hack core.  Create a definition of 
db_status_report in database.inc will will in turn call one of 
db_status_report_mysqli() or db_status_report_pgsql() dependent on the 
active database type.  You change the name of the db_status_report 
function in each of the database.mysqli.inc and database.pgsql.inc 
files accordingly.

Earnie -- http://for-my-kids.com/
-- http://give-me-an-offer.com/



More information about the support mailing list