473,499 Members | 1,589 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Who DIDN'T vote - need solution

1 New Member
Our local club has about 15 Board members, and we vote online using a mySQL/php web interface. I have several different queries/results that I print which show varying displays of motions/votes/tallies and so on. NOW our Board wants to not only see the summary listing for all motions, but also include a list of each Board member who DIDN'T vote on any motion. I've tried various joins, COUNT, etc. but so far I haven't been able to add the names of non-voting Board members to the summary list. Here are the three tables that track this data:

TABLE 1 - BOARDINFO
Name
Board Member
(plus more fields with more detail about each Board Member)
PRIMARY KEY is Position/Year/Name

TABLE 2 - MOTIONS
MotionID
Result
(plus more fields that have text of each motion, dates, proposers, etc.)
PRIMARY KEY is MotionID

TABLE 3 - VOTES
MotionID
BoardMember
Vote (enum YES, NO, ABSTAIN, etc.)
PRIMARY KEY is MotionID/BoardMember

Currently my code produces a webpage with this info:
-------------------------------------------

The PEOPLE'S CHOICE CLUB
Board Motions Summary

Vote

20070826-45-E - VP - Mary Molloy - Carried
20070825-44-E - Maximum length of Events - Carried
20070825-42-E - Events dedications - Carried
20070807-41-E - Approve printing of Policy Manual - Carried
20070806-40-E - Events for 2008 - Carried
20070806-39-E - Use phone for soliciting memberships - Carried
20070730-38-E - Change to Ballot format - Carried
20070723-38-E - Buy new tape recorder - Carried
20070722-37-E - Pay for photos of Board members for publication - Lacked Majority
20070715-36-E - Publish photos of Board members - Carried

etc.
-----------------------------------------------------------------

What I'm also trying to achieve is the addition of the following (or something similar):

MOTION ID DIDN'T VOTE

20070826-45-E - VP - Mary Molloy - Carried
Didn't Vote: John Doe
Jane Smith
Tim Tam
20070825-44-E - Maximum length of Events - Carried
Didn't Vote: Mike Walsh
Ed Baker
20070825-42-E - Events dedications - Carried
Didn't Vote: John Doe
Ed Baker
etc.

Once I get the code to properly select the non-voters, I can work on the php to do the web display, but right now I'm stumped.

I look forward to a KISS solution :-)

Thanks!
Sep 5 '07 #1
1 1266
r035198x
13,262 MVP
Our local club has about 15 Board members, and we vote online using a mySQL/php web interface. I have several different queries/results that I print which show varying displays of motions/votes/tallies and so on. NOW our Board wants to not only see the summary listing for all motions, but also include a list of each Board member who DIDN'T vote on any motion. I've tried various joins, COUNT, etc. but so far I haven't been able to add the names of non-voting Board members to the summary list. Here are the three tables that track this data:

TABLE 1 - BOARDINFO
Name
Board Member
(plus more fields with more detail about each Board Member)
PRIMARY KEY is Position/Year/Name

TABLE 2 - MOTIONS
MotionID
Result
(plus more fields that have text of each motion, dates, proposers, etc.)
PRIMARY KEY is MotionID

TABLE 3 - VOTES
MotionID
BoardMember
Vote (enum YES, NO, ABSTAIN, etc.)
PRIMARY KEY is MotionID/BoardMember

Currently my code produces a webpage with this info:
-------------------------------------------

The PEOPLE'S CHOICE CLUB
Board Motions Summary

Vote

20070826-45-E - VP - Mary Molloy - Carried
20070825-44-E - Maximum length of Events - Carried
20070825-42-E - Events dedications - Carried
20070807-41-E - Approve printing of Policy Manual - Carried
20070806-40-E - Events for 2008 - Carried
20070806-39-E - Use phone for soliciting memberships - Carried
20070730-38-E - Change to Ballot format - Carried
20070723-38-E - Buy new tape recorder - Carried
20070722-37-E - Pay for photos of Board members for publication - Lacked Majority
20070715-36-E - Publish photos of Board members - Carried

etc.
-----------------------------------------------------------------

What I'm also trying to achieve is the addition of the following (or something similar):

MOTION ID DIDN'T VOTE

20070826-45-E - VP - Mary Molloy - Carried
Didn't Vote: John Doe
Jane Smith
Tim Tam
20070825-44-E - Maximum length of Events - Carried
Didn't Vote: Mike Walsh
Ed Baker
20070825-42-E - Events dedications - Carried
Didn't Vote: John Doe
Ed Baker
etc.

Once I get the code to properly select the non-voters, I can work on the php to do the web display, but right now I'm stumped.

I look forward to a KISS solution :-)

Thanks!
If you don't create an entry for those who didn't vote, then you could do
Expand|Select|Wrap|Line Numbers
  1. select  BoardMember                 from BOARDINFO where BoardMember not in select BoardMember from VOTES
If you create an entry in VOTES for each member that did not vote and set that value to say, 'NOVOTE' , then you can do

Expand|Select|Wrap|Line Numbers
  1. select  BoardMember                 from BOARDINFO where BoardMember in (select BoardMember from VOTES where vote = 'NOVOTE')
Sep 5 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1640
by: Erwin Moller | last post by:
Hi, Bad EU behaviour. :-( source: http://lwn.net/Articles/84301/ Regards, Erwin Moller (The Netherlands)
1
2148
by: Otis Green | last post by:
Vote for or against a new newsgroup proposal. To summarize what you need to do, just send an empty e-mail to postgresql-ballot@netagw.com You will receive a ballot by e-mail. Follow the...
8
2663
by: William Drew | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.mysql This is an invitation to discuss the following proposal to create newsgroup comp.databases.mysql. Please note that YOU...
14
1435
by: Otis Green | last post by:
Vote for or against a new newsgroup proposal. To summarize what you need to do, just send an empty e-mail to postgresql-ballot@netagw.com You'll receive a ballot by e-mail. Follow the...
1
1434
by: Denis Van der Heyden | last post by:
Hi, I have a friend who creates non-professional films and he is actually on a german website. I want to vote for him a lot of time,and I would need to create a shortcut for the vote. When we...
18
1090
by: Urs Eichmann | last post by:
Make (at least Class Library) Projects shareable between VS 2003 und 2005 http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=572a25b7-4b3d-4364-8bd1-72fd99a18693 Thank...
6
1919
by: Showjumper | last post by:
I have built a rating server control. Whats the best way to ensure one vote per person? Check IP Addresses and allow 1 vote per IP address or via cookies? Thanks Ashok
5
1548
by: paitoon | last post by:
Hello, I have problem to add vote to the data base . In the form i have radio button to choose to rate the score 1 2 3 4 5 ....and when i click to submit this the score in database is changed by...
1
1427
by: vote4amin | last post by:
Dear frens, Need your help to spend a minute of your time to vote for my little boy in Cutefam 2008 contest. Please click --->>> http://www.thelilcaliph.com/CuteFam2008/voteWithCodes.html to...
0
7009
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4602
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3103
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.