Jump to content

[SOLVED] getting unique votes


bschvy

Recommended Posts

create table person (
   userid int not null
);

create table poll (

userid int references user(userid,; -- creates foreign key on user.userid
other_columns text

);

 

Load the poll, iterate through userId's. If any match current user's id, display error.

 

 

Link to comment
Share on other sites

I would think you would just want to query the said poll table before allowing them to vote. If you know they are logged in you should have their user id. It should be a simple query of the poll table that determines whether or not that user id exists for the selected poll. There should not be any need to iterate over the list.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.