Click to See Complete Forum and Search --> : A little advice pleaseż!?ˇ


john114
01-23-2003, 11:27 PM
I made a poll using basic ASP coding. I have access to a database but don't know how to use it(funny, huh?). When the user clicks on a poll answer, the value of the radio button is wrote to a text file. I was wondering if it was possibe to have ASP read the textfile, observe the results, and then post the results percentage wise? A response would be greatly appreciated.

jpmoriarty
01-24-2003, 03:39 AM
dont go down the text file route - destined for disaster. You need to write the value of the radio to a database field. Then to display the results you count how many results there are in the database and how many of each answser there are (two queries, one which returns all results and one which returns specific results ie "select * from votes where answer = false"). Then you divide the second number by the first, and voila you have a percentage.

If you dont know how to connect your poll to the database then I'd suggest these resources:

ASP 101 (http://www.asp101.com)
ASP Free (http://www.aspfree.com)
ASP tutorials and applications (http://www.webwizguide.info/asp/)
Kath's Active server pages (http://www.web-savant.com/users/kathi/asp/)
ASP from HTML goodies (http://www.htmlgoodies.com/asp/)

I'd strongly suggest trying to get to grips with it all from a tutorial than simply waiting for some nice chap (or chapess) to post the answer here - you've a much better chance of really understanding it from a tutorial I would guess - but I'm sure that people will be happy to help if you're having further problems.

john114
01-24-2003, 08:35 PM
thanx for your help