phpgroupware-developers
[Top][All Lists]
Advanced

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

[Phpgroupware-developers] 0.9.16 contacts communications problem


From: Andreas Schiller
Subject: [Phpgroupware-developers] 0.9.16 contacts communications problem
Date: Sat, 25 Oct 2003 14:24:32 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624

Hi there,


for those who do not know yet, let me introduce myself.
I am (parttime) involved in some developments around phpgw at probusiness.


Right now I am trying the 0.9.16 branch, updated from CVS last night.

I believe there is a serious (design-) problem while showing the communications tab for a (any) contact.

I'm quite sure you can't handle this with a single non-nested sql command, like you do.

The way it is implemented now, you'll get this sql statement (formatted for better readability)

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,
        contact_comm_descr.descr AS comm_description,
        contact_comm_type.comm_type_id AS comm_type_id
FROM
        phpgw_contact_comm_type AS contact_comm_type

    RIGHT  JOIN
        phpgw_contact_comm_descr AS contact_comm_descr
    ON contact_comm_descr.comm_type_id = contact_comm_type.comm_type_id

    RIGHT  JOIN
        phpgw_contact_comm AS contact_comm
    ON contact_comm.comm_descr_id = contact_comm_descr.comm_descr_id

    RIGHT  JOIN
        phpgw_contact AS contact_central
    ON contact_central.contact_id = contact_comm.contact_id

WHERE
        ((contact_comm.contact_id = 239))


This will lead to a big product of records restricted to contact_id=239.

(And so with some contacts filled in you will get a "memory exausted" error after some - here 12000 - records

I believe what you were trying to get is something like all comm_descr with filled in comm_data for contact_id.

Without last join with contact_central and without the restriction to contact_id 239 you would get a full list of contacts with every comm_descr and filled comm_data where exists.

But restricting to one contact_id gives just those records where comm_data exists.

I must commit I did not quite understand what you were trying to get from the last join - and neither I understood the sql_builder class right now. But I am quite sure you have to do 2 queries to get the result you want.

I would love to lend you a helping hand (in fact there would be two hands :-)). But I could not find documentation to the sql builder class, and I found it's quite hard to understand it from the code...


Greetz from Germany,
Andy Schiller






reply via email to

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