2 Replies - 1351 Views - Last Post: 14 May 2009 - 11:54 PM Rate Topic: -----

#1 [email protected]  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 310
  • Joined: 09-February 09

suggestions for a user rating system?

Post icon  Posted 14 May 2009 - 08:37 PM

hello,

this might be more of a db question, but i'll start here. i'm just looking for any direction in regards to a user feedback/rating system. users on my site buy and sell to one another and i would like to design a system that does the following:
- allows the buyer to rate and leave feedback at the end of a transaction
- allow the seller to respond/defend themselves in regards to the feedback given
- attach a score based off the rating (100 is perfect, 0 is not)
i've been reading various articles and i haven't been able to find a good starting point yet. i think i would create a table something like this:
rating_id(unique, auto_increment)
buyerUser_id
sellerUsername
rating_score(don't know how to set this up, would it be ENUM w/ a few options or should i just do an INT?  how would i make sure a value higher than 100 isn't entered?)
rating_comment (null)



i don't know if the above is right or going in the right direction... it would help me to know more about how i can retrieve the data from the db. any ideas, tips, etc.
thank you!

Is This A Good Question/Topic? 0
  • +

Replies To: suggestions for a user rating system?

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 5074
  • View blog
  • Posts: 13,697
  • Joined: 18-April 07

Re: suggestions for a user rating system?

Posted 14 May 2009 - 09:56 PM

Well this is certainly a db issue, but what I want to say is that you shouldn't think of this all in terms of the same table by any means. This is actually a few tables.

One table is where you outline the transaction. This I am sure you already have setup so that is good. The next table should be a comments table which ties to the transaction id in the transactions table and has a comment field. The table would be...

transaction_comments
-----------------------
ID
transactionid <--- Links to transaction table primary key
comment
date



No need to mention buyer and seller id in here because that should be in your transaction table records. This table merely ties one or more comments to an individual transaction record. ID is unique and auto_increment, transactionid can repeat (multiple comments can be left for a single transaction so you have a one to many relationship here)

The rating again would be a field in the transaction table because the transaction would contain who is selling, who is buying (this forms a transaction after all) and then the buyer's rating for that transaction.

transactions
-----------------------
ID <-- Transaction id
sellerid <--- Ties to users table
buyerid <--- Ties to users table also
date
amountofpurchase
buyer_rating



So as you can see with these two tables you can see how you can have multiple transactions between a seller and buyer, where each transaction can be rated by the buyer and through a link to the other table, multiple comments can be left by both seller and buyer regarding a single transaction.

Hope this is what you were looking to do. :)
Was This Post Helpful? 1
  • +
  • -

#3 [email protected]  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 310
  • Joined: 09-February 09

Re: suggestions for a user rating system?

Posted 14 May 2009 - 11:54 PM

thanks for the great explanation! i'm calling it a day(night), but i will put this together tomorrow and let you know how it turns out, thank again for the help.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1