Search found 7 matches

by Asaf
Wed Jul 06, 2011 9:34 pm
Forum: Web Related
Topic: How to implement an accurate rating system
Replies: 15
Views: 22721

Re: How to implement an accurate rating system

Hi Saman, first of all thank you very much for you advice. please tell me what do you think of my code. there are two functions setRating and getRating. the DB tables are: table: tbl_RATING: ITEM | TOTAL_NUMBER_OF_VOTES | THIS_RATING (average votes for this item) table: tbl_TOTAL_RATING: AVG_NUM_VOT...
by Asaf
Sat Jul 02, 2011 11:57 pm
Forum: Web Related
Topic: How to implement an accurate rating system
Replies: 15
Views: 22721

Re: How to implement an accurate rating system

I tried something like:
UPDATE tbl_RATING SET NUM_OF_VOTES = ((select NUM_OF_VOTES from tbl_RATING where ITEM=5) +1)
WHERE (((tbl_RATING.ITEM)=5))

but it didn't work...
by Asaf
Sat Jul 02, 2011 9:28 pm
Forum: Web Related
Topic: How to implement an accurate rating system
Replies: 15
Views: 22721

Re: How to implement an accurate rating system

Hello Saman, giving the table you have suggested: ITEM | TOTAL_NUMBER_OF_VOTES | TOTAL_RATING I need a MySQL statement that will do everything you said: 1. update new rating of an existing item in the rating table (update and select of current NUMBER _OF VOTES and THIS_RATING in one statement). 2. i...
by Asaf
Thu Jun 30, 2011 11:06 pm
Forum: Web Related
Topic: How to implement an accurate rating system
Replies: 15
Views: 22721

Re: How to implement an accurate rating system

Hi Saman,
The "single record" solution you mentioned sounds good.

Thank you very much
by Asaf
Thu Jun 30, 2011 4:56 pm
Forum: Web Related
Topic: How to implement an accurate rating system
Replies: 15
Views: 22721

Re: How to implement an accurate rating system

Hi Saman, first, you guessed wrong, I am not mayilgilli, although it does look like a strange coincidence :). As to your solution, I will examine it later. I asked a different thing, I want to make things much simpler, I consider 10 vote as a reliable rating, it doesn't matter to me if I have 1000 v...
by Asaf
Wed Jun 29, 2011 6:59 pm
Forum: Web Related
Topic: How to implement an accurate rating system
Replies: 15
Views: 22721

Re: How to implement an accurate rating system

Hello Saman. Thanks for your reply. my problem is this, if I have, let’s say 1000 items, and each got 100 votes, I end up with a table of a million rows!! every time I would like to display the rating of a specific item, I would need to access this table with a million rows and go over all these mil...
by Asaf
Tue Jun 28, 2011 11:13 pm
Forum: Web Related
Topic: How to implement an accurate rating system
Replies: 15
Views: 22721

Re: How to implement an accurate rating system

Hi can you please show how the voting table looks like?
is it as follows?
itemvote
14
13
14
15
23
23
24
33
34
34
42
Thanks

Go to advanced search