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.

 

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.