phpgroupware-developers
[Top][All Lists]
Advanced

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

Re: [Phpgroupware-developers] 0.9.16 contacts communications problem


From: Edgar Luna
Subject: Re: [Phpgroupware-developers] 0.9.16 contacts communications problem
Date: Sun, 26 Oct 2003 21:49:13 -0600
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

Andreas Schiller <address@hidden> writes:

> Edgar,

>> Just to be sure:
>> /* $Id: class.sql_builder.inc.php,v 1.1.2.14 2003/10/21 01:08:15 alexbsa Exp 
>> $ */

> I am afraid, the query was out of version 1.1.2.13... but the
> resulting memory error was also with 1.1.2.14 (I'm not quite sure,
> whether I checked the query with 1.1.2.14... sorry)
Yeah, the bugfix hasn't been committed, and won't be while I can't be
sure that don't create another bug.

> The correct query would be a nested one, something like
I see what you intent, just is impossible to phpGroupWare while mysql
don't support it and phpGW support at least a version that support it.

Just for this I didn't write anything that allow this kind of queries,
if this could be possible so much parts of contacts could become
easier.

But with few haking will be possible request the select part, and the
where part and then another sql is builded then you could use this and
concatenate it :), sql builder don't make db stuff (well I had to add
a query because don't want to add another class for contacts sorry for
that but I'm under pressure :P), just build queries.

in two levels:

syntax of functions, datatypes, operators in class.sql.inc.php,
class.sql_(mysql|pgsql|mssql).inc.php

Entity-relation, class.sql_entity.inc.php and
class.sql_builder.inc.php

The idea is that each sql_entity extended class could do by own:
- Update, delete, insert and catalog-select (simple select without
joins).
- Know about fields and his datatypes, keys that import and export.

sql_builder know how to create SELECT queries, because it has $map,
then know how to find each entity based on this variable, with this
and the methods that find the `path' (sort_by_distances,
entity_to_center basically), they prepare the route that will be used
by get_sql, (if you see contacts this method return the query), which
call get_join and this make the FROM part.

But whatever this become on two queries, I'm not really sure this is
better with many hits and in all cases (few records and many hits), I
could see any advantage but like I said we can't do it atm.

> This will first select those comm_data for the contact(s) in question
> and then do the join
I got it, but can't for this, maybe mysql 5? (I fixed your query and
tried on PostgreSQL and runs smooth, but mysql give a syntax error).

Here is:

SELECT
        contact_comm.comm_contact_id AS comm_contact_id,
        contact_comm.key_comm_id AS key_comm_id,
        contact_comm.comm_preferred AS comm_preferred,
        contact_comm.comm_data AS comm_data,
        contact_comm.comm_descr_id AS comm_descr,
        contact_comm_descr.descr AS comm_description
FROM
        phpgw_contact_comm_descr AS contact_comm_descr
RIGHT JOIN 
      ( SELECT
                 contact_comm.contact_id AS comm_contact_id,
                 contact_comm.comm_id AS key_comm_id,
                 contact_comm.preferred AS comm_preferred,
                 contact_comm.comm_data AS comm_data,
                 contact_comm.comm_descr_id AS comm_descr_id
        FROM
                 phpgw_contact_comm AS contact_comm
        WHERE
                 ((contact_comm.contact_id = 9)) )
        AS contact_comm
        ON contact_comm_descr.comm_descr_id = contact_comm.comm_descr_id;

> I will come back to you, but in fact I haven't understand the whole
> concept right know.
I have a post here about a bit on this[¹] (of course outdated), and
the few lines above. If you need more info I'll try to answer.

Best Regards.

Footnotes: 
[¹] 
http://mail.gnu.org/archive/html/phpgroupware-developers/2003-09/msg00053.html

-- 
Edgar Antonio Luna Díaz - http://www.sogrp.com
Fingerprint: C008 5EAC 5272 AC8C 7589  4821 8B34 6166 8733 8310




reply via email to

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