2 Replies - 1501 Views - Last Post: 01 April 2010 - 03:10 AM Rate Topic: -----

#1 heyoman1  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 64
  • View blog
  • Posts: 735
  • Joined: 30-November 09

Voting system

Posted 31 March 2010 - 03:58 PM

I would like to make voting system in my website where a person would vote from 6 choices, and then below the polls the latest results would be shown. for example:

My name is:


The current results are (they aren't lined up unfortunately)

Andrew: ||||||| 7
Bill: ||| 3
Michael:||||| 5
Adam: | 1
Luis: || 2
Ricky: |||| 4

I understand that php and mysql are used, so can you tell me what table is needed in mysql(through xampp) and the php code to do this. Thanks in advance!

This post has been edited by heyoman1: 31 March 2010 - 03:59 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Voting system

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1653
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Voting system

Posted 31 March 2010 - 04:18 PM

Sorry but we can not give you the entire code to solve your problem. We are here to assist in solving problems with code you have written, with any error messages you are getting or what isn't working the way that you expect it to, we would be more than happy to help you with those problems. If there is a topic that you don't understand we would be more than happy to help you with that as well. Make sure to post any code with in code tags like below.


Be sure to visit our tutorial and snippet areas or read the FAQS at the top of the forums. Also, take a moment to read the rules about posting topics.

Thank you for helping us to help you solve your problem.
Was This Post Helpful? 0
  • +
  • -

#3 reaper4334  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 107
  • Joined: 01-November 09

Re: Voting system

Posted 01 April 2010 - 03:10 AM

The design of the table in mysql is pretty much up to you with something this small.

Personally, I'd have a Name field and a NumberOfVotes field, then each record would represent each possibility and how many votes that has.

As far as the PHP goes, it should be pretty simple to just retreive all the information you need from the database and output it whereever you want it by using simple mysql_query calls.

However, as PsychoCoder said, it's not really the way things work here for you to be just given the codeas you ask for it.
So give it a try yourself, and come back and ask for help if you struggle, but make sure you put plenty of effort in yourself.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1