phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] connect to and query other databases


From: Miles Lott
Subject: Re: [Phpgroupware-developers] connect to and query other databases
Date: Wed, 22 May 2002 07:20:19 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc2) Gecko/20020510

$other = CreateObject('phpgwapi.db');
$other->Host     = 'dbhost.mydomain.com';
$other->Type     = 'pgsql';
$other->Database = 'notphpgw';
$other->User     = 'someuser';
$other->Password = 'somepass';

There you have a new db object ready to query another db.

$other->query('SELECT * FROM strange_table WHERE field=' . $account_id,__LINE__,__FILE__);

...

Pim Snel wrote:
Hello all,

Can somebody tell me how I can use functions from the phpgwapi to connect to 
another database
and do queries on it? At the moment I use direct mysql_query and connect 
functions. I know
this is a bad thing to do.

Maybe you can give me a phpgw equal to the following:

   $conn=mysql_pconnect($localhost,$user,$database);
   mysql_select_db($database, $conn);

   $SQL='SELECT * FROM '. $table . ' WHERE';
   $result=mysql_query($SQL,$connection);

I'm working on a multiuser/multisite contentmanagement system in phpGW which 
works with a
single database per site. It's kind of a phpMyAdmin with specified 
contentmanagement tasks
an capabilities like uploading images and containing relations between tables.

I'll give you all a preview when it's more stable.

Thanks

Pim Snel









reply via email to

[Prev in Thread] Current Thread [Next in Thread]