Thank you I realized that the commas were missing
now i recieving this php error
PHP Code:
Notice: Undefined index: in C:\wamp\www\shoes\stores\itemdetails2.php on line 465
1 Star Active
PHP Code:
$query ="SELECT rating , COUNT(*) AS rating_counts FROM rating
WHERE item_name = '$platename' GROUP BY rating";
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
// see if any rows were returned
if (mysql_num_rows($result) > 0) {
$ratings = array_fill(1,5,0);
$rowsCount = count($result); // assume $rows is the result array
for($i=0;$i<$rowsCount;$i++) {
$ratings[$result[$i]['rating']]++; // line 465
i don't get why it is referring to undefined index because rating is a column field in the database rating I guess it is talking about 'rating'
Bookmarks