Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Alan Little
August 22, 2005, 12:08 pm
rate this thread
to record votes on the links.
Is it possible to get the link data, the click count, vote count and vote
total in one query?
I can get the click count OK, but as soon as I add the vote count to the
query, it multiplies them; e.g. for a link with 14 clicks and 2 votes, it
tells me 28 for both figures. Here's the query:
select lnk.LinkID, URL, LinkTitle, Description, count(log.LinkID) Clicks,
from fn_links lnk
left join fn_log log using (LinkID)
left join fn_rate vot using (LinkID)
where CatID = $CatID
and Status = $Active
group by lnk.LinkID
order by Created
Then of course I want to include sum(Rating). I tried grouping on
different things, but it makes no difference.
Phorm PHP Form Processor
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum