dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Building A Poll

  1. #1
    Join Date
    Jan 2005
    Location
    Fife, Scotland
    Posts
    157

    Building A Poll

    How do you go about creating a poll using PHP and My SQL?

    I don't really have a clue where to start,

    Create a table called 'Polls'

    12 colums, ID, Question, and 10 Options?

    How do you create it so it counts the clicks each one has recieved, or show percentages etc etc?

  2. #2
    Join Date
    Jan 2005
    Location
    Illinois
    Posts
    815
    Have a look through these premade ones:
    http://hotscripts.com/PHP/Scripts_an...ing/index.html

    -Steve

  3. #3
    Join Date
    Jan 2005
    Location
    Fife, Scotland
    Posts
    157
    Ta,

    But what I was actually looking for was:

    On a forum, if a user wants to create a poll about something, then they can do, just like posting a reply or a thread about something

  4. #4
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    You would have a seperate table with the polls in, if the user wants a poll you would add a new line to this table, then use mysql_insert_id(); to retrive the ID and store that in your threads table under a "polls" feild.

    When the user veiws it you would grab the poll feild, if it's zero, then the user doesn't want a poll, otherwise retrive it and display acordingly.

    Voting is a simple matter of an update query.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles