Share » Forums » Install & configuration » Two database connections

Two database connections

Two database connections

Tuesday 21 December 2004 12:41:13 am - 2 replies

Author Message

Shafiq Far

Wednesday 02 February 2005 7:44:04 am

Hi-

I'm having the same problem - <i>except using PostgreSQL.</i>

If anyone around knows how to get around this please let me know.

Thanks,

Sjoerd van Steijn

Tuesday 15 February 2005 6:03:47 am

I think the reason why i can't make two database connections is to protect other websites. I have found a solution to work around this problem. I removed the getDB function in the module and used the global variable arrdbaccess["dbname"] in the queries (in my module classes) to contact the database correctly. for example

function functionname($var1,$var2) {
global $arrdbaccess;

$sql="SELECT field1 FROM ".$arrdbaccess['dbname'].".table WHERE field2='".$var1."' and field3='".$var2."' ";

$result = run_rentequery($sql);
return $result;
}

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu