Hi; I'll get right to my description and problem:
I am trying to design a poll. I am trying to build results for it by using two tables: poll_options and poll_votes. So, what I want to do is count how many times an option was voted for -and- include the option information. I've tried this, but I want the count() to return 0 (zero) also instead of just leaving that row out if there are no votes for an option. Here's my sql:
select poll_options.*, poll_votes.*, count(poll_votes.polloptionid) from poll_options, poll_votes where poll_options.polloptionid = poll_votes.polloptionid group by poll_votes.polloptionid;
If you need table definitions and data, let me know.
I am trying to design a poll. I am trying to build results for it by using two tables: poll_options and poll_votes. So, what I want to do is count how many times an option was voted for -and- include the option information. I've tried this, but I want the count() to return 0 (zero) also instead of just leaving that row out if there are no votes for an option. Here's my sql:
select poll_options.*, poll_votes.*, count(poll_votes.polloptionid) from poll_options, poll_votes where poll_options.polloptionid = poll_votes.polloptionid group by poll_votes.polloptionid;
If you need table definitions and data, let me know.