So, I’m trying to set up a rating system and am trying to do some operations on the number of reviews and ratings. I have the following code:
{exp:channel:entries channel="businesses" entry_id="{entry_id}” dynamic=“no” limit=“1”}
{reverse_related_entries entry_id="6"}
<?php
$rating = 0;
$num_reviews = 0;
?>
<?php
$num_reviews++;
$rating += floatval(’{rating}’) * 20;
?>
{/reverse_related_entries}
{/exp:channel:entries}
the problem (one of many) is that $num_reviews returns 1 1 1 1 1. There are 5 reviews so I am guessing that it is looping 5 times, but each loop starts at value of 0. My desire result is that if it loops 5 times (once for each review), it should increment thusly: 1 2 3 4 5. Any ideas? not sure if I even make sense (much of this is new to me)