Login   Register  
PHP Classes
elePHPant
Icontem

Any way to have a constant number of votes per user?

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      PHP Ajax Voting system  >  All threads  >  Any way to have a constant number of votes per user?  >  (Un) Subscribe thread alerts  
Subject:Any way to have a constant number of votes per user?
Summary:Can we set a constant number of votes per user ? for example, a
Messages:2
Author:Marios Pavlou
Date:2013-03-27 14:02:22
Update:2013-03-27 17:28:32
 

  1. Any way to have a constant number of votes per user?   Reply   Report abuse  
Picture of Marios Pavlou
Marios Pavlou
2013-03-27 14:02:23
Can we set a constant number of votes per user ?
for example, a user can only vote 3 times (3 different items)

  2. Re: Any way to have a constant number of votes per user?   Reply   Report abuse  
Picture of Nick Asenov
Nick Asenov
2013-03-27 17:28:32 - In reply to message 1 from Marios Pavlou
Hello,

Depends on how we will track users-per IP or via our own login system, we can extend table `vots` adding a column for IP/username, and (id,username) must be an unique key-this limits votes for a single product per user_name(because vots.id references to articles.id).
Also depend on how must be the system behaviour we can choose how to insert data into table `vots` (against its UNIQUE KEY (id,username)): by "insert ignore","insert...on duplicate key update" or even "replace into table..."

Regards