>Your message is a reply to anothers post and is more than 100 lines of
text. Unless you are
>a major writer, your probably adding a lot of the previous replies. Please
trim your posts
>when replying. Thank you.
Looks good to me, here is a layout from one I did…
tbl_Polls
PollID autonumber PK
PollQuestion text
DateAdded date/time
PollStatus number
tbl_PollAnswers
AnswerID autonumber PK
PolID number
SortID number
Tbl_PollResults
ResultID autonumber PK
PollID number
AnswerID number
DateAdded date/time
IPAddress text
I can grab a poll who’s status is NOT 0 from tbl_Polls, then grab all
Answers from PollAnswers where PollID = PollID from my first query ordered
by SortID… and that’s all to display the poll and build the form.
The form fields were radio buttons named something like PollOption
value=”#AnswerID#”
1 1 1 9/10/2004 192.168.1.101
2 1 3 9/11/2004 192.168.1.102
3 1 2 9/12/2004 192.168.1.103
4 1 3 9/13/2004 192.168.1.104
ResultsID is of course the ID of the record in the result table
PollID is what poll the result belongs to
AnswerID is the answer they chose
DateAdded is the date/time they took the poll
IPAddress is #cgi.remote_addr# just so they don’t submit over and over
I’d have to check but I’m pretty sure I got result count before displaying
the polls. If they were less than 100, I allowed it to be taken again; else
I set the status to 0, closing the poll for good.
The percentage results I had worked no matter the number of results, but I
liked it ending up a nice round number.
Now I can grab the number of results for any poll
I can get the date last used from the latest date in tbl_Answers
Can easily get percentage results from one table
If the field existed, add its value to the database it’s value is the
answered, a hidden field for the pollID and your in business.
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.754 / Virus Database: 504 - Release Date: 9/6/2004
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.759 / Virus Database: 508 - Release Date: 9/9/2004
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]