Forums

ASP

This topic is locked

some trouble with poll script

Posted 02 Jun 2003 20:44:22
1
has voted
02 Jun 2003 20:44:22 Kristian Waagsboe posted:
In my user db (mysql), people can vote on some things.

example:
My name is Kristian. On my page they can vote on 4 different things (vote1,vote2,vote3,vote4).

I also have a index page where some info about theese votes should be displayed. Who is most vote1? who is most vote2 and so on. This was easily done in MS access with queries and 4 recordsets in dreamweaver.

the one who has most votes on vote1 isn't necessary the one who is most vote1. To sort this out i need prosent fields.

on the index page i want to:
- show the users with highest prosent values in each category.

hope this was understandable. Please help me <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

.:. DWMX .:. MS IIS 5.1 .:. WinXP .:. MySQL .:. ASP VB

Replies

Replied 03 Jun 2003 09:15:43
03 Jun 2003 09:15:43 Vince Baker replied:
Can you not run a query using the count method?

e.g.

Select Count (vote1)
from yourtable

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 03 Jun 2003 14:11:41
03 Jun 2003 14:11:41 Kristian Waagsboe replied:
in access i created a query like this:

prosent1:[vote1]/([vote1]+[vote2]+[vote3]+[vote4])*100

This gave me the prosent values in the recordset, so it was easy to sort by them. But I'm not that experienced with queries in mysql. Can I somehow create a similar query in mysql?

Example why it wont work with who many voted on a person...:
person 1 has 10 votes in vote1, 200 votes in vote2 and so on.
person 2 has 5 votes in vote1, 2 votes in vote2 and so on.

Person 1 will be the winner. I need a way to keep this from happening...

.:. DWMX .:. MS IIS 5.1 .:. WinXP .:. MySQL .:. ASP VB
Replied 04 Jun 2003 18:49:31
04 Jun 2003 18:49:31 Kristian Waagsboe replied:
*bump*

please, anybody?

.:. DWMX .:. MS IIS 5.1 .:. WinXP .:. MySQL .:. ASP VB

Reply to this topic