there are 3 tables
DOMAINS
--- domains_pics
--- domains_guestbook
1st query [works well]
let me explain first - its pretty simple. i want to list domains and count number of pictures for each domain [watch COUNT... and GROUP BY - i am grouping by id_domain in pictures table].
SELECT <something>, COUNT(domains_pics.id) FROM domains LEFT JOIN domains_pics ON domains.id=domains_pics.id_domain WHERE <something> GROUP BY domains.id, domains_pics.id_domain
2nd query [cant figure it out]
now i want to use same thing as above but i want to add counter for guestbook entries - logic is same as with pictures. every domain can have X pictures and Y guestbook entries. so i thought i will just add another LEFT JOIN somehow with parameter
domains LEFT JOIN domains_guestbook ON domains.id=domains_guestbook.id_domain
and have all in one result - domainname, number of pics and number of guestbook entries. i also added GROUP BY for id_domain in guestbook table
domains.id, domains_#guestbook#.id_domain
but i think the problem is in that GROUP BY! i am lost now :-X