Getting value of C Star Rating

Hi guys,

I’m trying to impliment a star rating system for my website by implementing the following code:


Everything’s working fine and nicely, but i need to store the value into my database and have no idea how to extract/retrieve the value the user selected. I tried searching thru google and apparently no one’s asking such a retarded question such as i, could any pros out there enlighten me? =[

I’ll probably retrieve the value from cstarrating and from my database, find the average and update back into the database, unless there’s a built in function in yii which im unaware of o.o

Thanks in advance!



CStarRating displays a star rating control that can collect user rating input.

CStarRating is based on jQuery Star Rating Plugin. It displays a list of stars indicating the rating values. Users can toggle these stars to indicate their rating input. On the server side, when the rating input is submitted, the value can be retrieved in the same way as working with a normal HTML input. For example, using


we can retrieve the rating value via $_POST['rating'].

Hey guys I am also working on CStarRating widget I am getting data from database and I am using as follow :

$review = Reviews::model()->findAll();

		foreach($review as $review)











			echo "<br/>";

			echo $review['title'];

			echo "<br/>";

			echo "<font color='brown'>".ucfirst($review['name'])."</font><br/>";

			echo $review['body'];

			echo "<hr/><br/>";



but when I get first data then result is ok as attached in 1.jpg



and when I get second data then both the rating star collasp as in 2.jpg,


what should I do in this case ?

hey guys I only get a radio buttons when i bring in the widget. what am I doing wrong pls?


I am also using the foundation3 extension for my content and i call this widget within that widget. dont know if that might affect each other

$form=$this->beginWidget(‘foundation.widgets.FounActiveForm’, array(‘id’=>‘product-form’));



thanks for any help.

Hi Friends,

see this