> select * from main
>               left join fof on main.id = fof.id
>               left join pub on main.id = pub.id
>               left join gov on main.id = gov.id
>               left join med on main.id = med.id
>               left join ngo on main.id = ngo.id
>               left join own on main.id = own.id
>               left join sup on main.id = sup.id
[snip]
> BUT, although it seems to be "joining" the tables correctly AND only
> returning the ones with the correct date criteria, it does NOT return
> the "id" or the "information_sent" fields correctly ( due to duplication
> in the result )
>
> Can this be done in one query without sub-selects, or should it
> be broken up
> (in which case I would still need help with the logic and to minimize the
> amount of queries inside loops)
>

Instead of select * list out the fields you want to select and alias the
duplicates, for example

select fof.id as fof_id, pub.id as pub_id, gov.id as gov_id etc.

Then when you do you mysql_fetch_array the indexes will be the aliases you
gave the columns so nothing will get overwritten.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to