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: Andy Mayer
Subject: Re: [Phpgroupware-developers] connect to and query other databases
Date: Wed, 22 May 2002 12:05:06 +0100

I did exactly the same thing for a content management system hooked 
onto the front phpgw login screen. It enabled users to get access pages 
of information about the phpgw system, before they logged in.

... but I used the same phpgw database, rather than a separate one:

$db = $GLOBALS['phpgw']->db;
$sql = 'SELECT * FROM '. $table . ' WHERE '. $where_clause;
$db->query($sql,__LINE__,__FILE__);
while ($db->next_record()) {
   echo $db->f('columnname1');
   echo $db->f('columnname2');
}

AFAIK the api is not designed to use multiple databases concurrently... 
but anybody else in the know please feel free to correct me!

Andy Mayer
---
Delivering solutions to provide dynamic
content over web, wap and PDA platforms. 
http:// www.andymayer.net

> 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
> 
> 
> 
> -- 
> Lingewoud B.V.            Tel. +31 418 663963
> Maasdijk 4              Fax. +31 418 663053
> 5328 BG Rossum Gld        address@hidden
> The Netherlands                 http://www.lingewoud.nl
> 
> 
> _______________________________________________
> Phpgroupware-developers mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
> 
> 





reply via email to

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