473,394 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Rating

Hello every one
i had a question i am developing a site where i want users to be able to
rate products..but i want users to be able to only vote once per
product...i was wondering if any of you know could shed some light on
how i can accomplish this..i thought of using cookies but cookies can be
deleted...how can i keep track if a speicifc user has voted for a
specficed product or not

thank you

---
Best Regards
Amir

*** Sent via Developersdex http://www.developersdex.com ***
Jan 28 '06 #1
4 1556
Hi Amir,
probably the most affective way to do this is to require the user to
register and login before they can vote. Obviously if they really want they
can have multiple logins but it would be a deterant. Once the usre has voted
they are not allowed to vote again.

Mark.

"Amir Ghezelbash" wrote:
Hello every one
i had a question i am developing a site where i want users to be able to
rate products..but i want users to be able to only vote once per
product...i was wondering if any of you know could shed some light on
how i can accomplish this..i thought of using cookies but cookies can be
deleted...how can i keep track if a speicifc user has voted for a
specficed product or not

thank you

---
Best Regards
Amir

*** Sent via Developersdex http://www.developersdex.com ***

Jan 28 '06 #2

Hi Mark,
Thank you for your reply..users do have accounts...but my problem is how
to keep track of what user has voted for what product..i mean i dont
really want it to get into Sql sever..becuase it would just be a huge db
filler..you know all users ...all products..what products have
voted..what users have voted for that specific product...all too
overwhleming...is there an easy way of doing this?
---
Best Regards
Amir

*** Sent via Developersdex http://www.developersdex.com ***
Jan 28 '06 #3
Hi Amir
RE:
<< it would just be a huge db filler..you know all users ...all
products..what products have voted..what users have voted for that specific
product...all too overwhleming...i>>

It wouldn't have to be as huge as you say if you have a good data model for
this piece. You could have a simple junction table that logically sits
between your [users] and [products] tables. Only enter a row in this
junction table if the user voted. Absence of a row means absence of a vote.
So if the query "tell me if UserX has voted on ProductZ" returns zero rows,
then you know the user has not yet voted. The junction table could also
include additional properties of the vote, itself, like Date/Time of the
vote, or a product grade assigned (if they can assign some grade to a
product as part of their vote). This junction table could be relatively
small if all it has to do is store numeric IDs. Even tens of thousands of
rows would not amount to much space if it's just numerical and Date/Time
data.

-HTH


"Amir Ghezelbash" <am*******@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...

Hi Mark,
Thank you for your reply..users do have accounts...but my problem is how
to keep track of what user has voted for what product..i mean i dont
really want it to get into Sql sever..becuase it would just be a huge db
filler..you know all users ...all products..what products have
voted..what users have voted for that specific product...all too
overwhleming...is there an easy way of doing this?
---
Best Regards
Amir

*** Sent via Developersdex http://www.developersdex.com ***

Jan 28 '06 #4
Amir Ghezelbash wrote:
Hi Mark,
Thank you for your reply..users do have accounts...but my problem is how
to keep track of what user has voted for what product..i mean i dont
really want it to get into Sql sever..becuase it would just be a huge db
filler..you know all users ...all products..what products have
voted..what users have voted for that specific product...all too
overwhleming...is there an easy way of doing this?
---
Best Regards
Amir

*** Sent via Developersdex http://www.developersdex.com ***


There are only so many ways to do something like this:

-Cookies (not really effective like you said)
-Tracking by IP (quite bad too, lots of people can share the same IP on
some networks, ppl can use proxies to cheat the system still, ppl on
dialup with dynamic IPs, etc)
-And the old tracking with a database... A simple table like this should
work:

[ID] ID/pri key of ratings table (could do without if you wanted to...)
[UserID] FK to user's table
[ProductID] FK to products table
[Rating] the rating/vote itself

But yes, it can grow quite a lot (you could theorically have as many
rows in it than total_users*total_products; although that won't happen
it can get quite huge if site is big and popular), more burden on the DB
itself, more queries executed per page, more code, more sprocs, more
business logic/rules, more unit tests, more bugs to fix, etc. It's not
that huge or overwhelming, but I can see why you don't really feel like
it either, but it's the only real way to do this unfortunately.
Jan 29 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jeremy | last post by:
this is probably a simple sql solution, but i could use some help. i've got one table that has rows of documents, and another table with any number of ratings for each of the documents. The rating...
2
by: alex | last post by:
I need a more advanced formula than just an average for calculating items rating. I have: raitng value is on scale 1 to 10. s - sum of all ratings for an item n - number of rates (votes)
0
by: soma | last post by:
I have a rating system on a forum I'm building. Users can rate a topic either good or bad. For each Good rating, one point is added to the topic's score. For every Bad rating, one point is subtracted...
8
by: kp87 | last post by:
I am a little bit stuck .... I want to play a bunch of soundfiles randomly, but i want to give each soundfile a rating (say 0-100) and have the likelihood that the file be chosen be tied to its...
2
by: Baron Samedi | last post by:
I am looking for a simple rating script whcih does not require SQL. Thanks in advance for any help.
4
by: bp90210 | last post by:
If you have a few minutes, I would like to see if anyone can help me out. I'm trying to modify a rating script. Currently, It allows you to vote over and over. What I want to do is after you vote...
3
by: cbtube03 | last post by:
Is there a package rating system for the Cheese Shop, like how Perl has cpanratings (http://cpanratings.perl.org/)? Do you think it would be useful? I see that we already have Cheesecake...
4
by: clintonG | last post by:
I've been searching around and also ask for your recommendations for a rating solution, i.e. I'm a small potato and prefer C# open-source at no cost but also seek recommendations for commercial...
1
by: lamarant | last post by:
Hi...I'm trying to use the Rating Control in the Ajax Toolkit in a datalist. I have the control showing up in the list, with the logged in users current rating for each item in the list showing... ...
1
pradeepjain
by: pradeepjain | last post by:
Hii guys , I have several products in my mysql database and i wanna allow the authorized users to rate the products !! i am clear till this point like it has to be done with the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.