473,624 Members | 2,254 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 1275
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
1650
by: Erwin Moller | last post by:
Hi, Bad EU behaviour. :-( source: http://lwn.net/Articles/84301/ Regards, Erwin Moller (The Netherlands)
1
2164
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 instructions and vote. _______________________________________________________________________ FIRST CALL FOR VOTES (of 2)
8
2676
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 CANNOT VOTE NOW; you may be able to vote on a version of this proposal later. See the PROCEDURE section below if you need information about how the discussion works. PLEASE POST ANY FOLLOWUPS TO THE NEWSGROUP NEWS.GROUPS.
14
1446
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 instructions and vote. _______________________________________________________________________ FIRST CALL FOR VOTES (of 2)
1
1446
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 open the main page, http://www.prophoto-online.de/index.php?name=photokinavideofun.php his movie: Olivier Naisy, (F)
18
1106
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 you! Urs
6
1924
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
1556
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 the score i chose but it not plus it selv....what should i do. here is my code : $id_vdo=$_POST; $name_vdo=$_POST; $rate=$_POST; include "connect.php";
1
1436
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 vote. The rule is only one vote per ip per day. So, you can only vote once a day until 28th June. Appreciate if you can forward this link to your frens and family. Thanks a lot in advanced for your help.
0
8233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8170
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8675
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8334
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.