473,725 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

star rating system

pradeepjain
563 Contributor
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 combination of ajax,php,mysql . I have a requirement for which i dono how to go about i.e the user once rated a product must be allowed to change his rating also!!! i was only thinking of average and rating feature!!!any help on changing the rating !!

this is the rating system i am using

http://www.masugadesign.com/the-lab/...ar-rating-bar/
Oct 8 '09 #1
1 2138
dlite922
1,584 Recognized Expert Top Contributor
I can't see your link but nevertheless, how I would do it is store the user_id, the product and their rating in a table.

Yes, it's true that if every user gave a rating to every product your table will be (Total User x Total Products) huge compared to just (1 x Total Products).

Protip: use REPLACE INTO for this table as a query. If there's no rating with this user/product it will create it, if there is it will update it.

Peace,



Dan
Oct 8 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1625
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 table is linked with an id column. the issue i am running up against is returning a single average rating for a document. SELECT document.title, (SELECT AVG(scale) FROM Rating, document WHERE document.pkDocumentId = rating.documentId)
8
1996
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 rating so that the higher the rating the more likely a file is to be chosen. Then i need some additional flags for repetition, and some other business. I am guessing a dictionary would be a great way to do this, with the key being the soundfile...
2
1868
by: Brian | last post by:
Hi - Does anyone know how Netflix manages its star rating system? The javascript is either computer generated or obfusicated. It's more trouble to reverse engineer than it's worth. I'm not very interested in their particular solution for rating movies - I'm not in the business - but I'd like to know the data transfer mechanism behind it. It looks like they found a solid way of moving data between client and server without getting...
2
2311
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.
0
2207
by: Ben Butschko | last post by:
Hi @all! I've got a little problem: I want to use a Star Rater Script (CSS Design) for an Voting Formular. http://komodomedia.com/blog/samples/ratings.htm The values can be written via javascript (on Click(); ) to a (hidden) formfield to transport it to another page and store the value with php into a mysql database.
3
1428
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 (http://pycheesecake.org/) for rating a package's kwalitee (like Perl's CPANTS). But browsing the Cheese Shop, I don't see a way to view or sort by Cheesecake rating... How can I see the kwalitee ratings of the packages at the Cheese Shop?
5
2449
by: gubbachchi | last post by:
Hi, I need to store the star rated values in mysql. How will I do it. This is the code I have used to create the star rater, <ul class="star-rating small-star"> <li class="current-rating" style="width:50%">Currently 2.5/5 Stars.</li> <li><a href="#" title="1 star out of 5" class="one-star">1</a></li> <li><a href="#" title="2 stars out of 5" class="two-stars">2</a></li> <li><a href="#" title="3 stars out of 5"...
4
3533
by: MissElegant | last post by:
Hi every body I wanna find someone in here who'd create me a 5-star rating system for my website using Javascript. The script should accept the rating a user made and place a cookie on the computer to remember what rating the user made. More than 10 of them should work on one page as well! Please help me. PS: Only use javascript and html of course.
4
2633
pradeepjain
by: pradeepjain | last post by:
I have a small problem . I want to build a rating system where in a user rates 5-6 features of a product . i don't want to update the server database on each click of the product feature but after he has done with all the feature rating he should be able to submit!!! i have problem in generating this stars ...i need to highlight say 1-3 stars when 3rd star is clicked and how do i pass the value when updating .... i use php as server side...
0
8750
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9104
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6010
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4509
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4780
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3217
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2154
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.