Question: i still cannot get this review system to work properly.
i know the average rating is 3.57 but as soon as i add the if() all i am getting is an output of 1?

```
// collect 5 lastest reviews for viewing
$sql = "SELECT AVG(rating) FROM reviews WHERE review_id = '$id'";
    $query = mysqli_query($conn, $sql);
    $AvgReview = mysqli_fetch_row($query);
    // Here we have the toatal row count
    $AvgReviews = $AvgReview[0];
if($AvgReviews = 1){
    echo '1star';
}
//next else is new
else if($AvgReviews >= 1){
    echo '2star';
}
//next else is new
else if($AvgReviews >= 2){
    echo '3star';
}
//next else is new
else if($AvgReviews >= 3){
    echo '4star';
}
//next else is new
else if($AvgReviews >= 4){
    echo '5star';
}  

```

Answer: 
You are getting '1star' because you are assigning a value of 1 to $AvgReviews.  

Change your code to compare the value.

```
if ($AvgReviews == 1) {

```

Additionally, you need to reverse your code or you will end up getting 1 or 2 stars, only.
I would recommend to change it like that:

```
if ($AvgReviews > 4) {
    echo '5star';
}
else if($AvgReviews > 3) {
    echo '4star';
}
else if($AvgReviews > 2) {
    echo '3star';
}
else if($AvgReviews > 1) {
    echo '2star';
}
else {
    echo '1star';
}

```
It's because you're assigning `1` to `$AvgReviews`. The [assignment operator](http://php.net/manual/en/language.operators.assignment.php) (`=`) takes the value on the right-hand side, assigns it to the name on the left-hand side, and then returns the value that was assigned. In this case, that's always `1`, which PHP interprets as `true`.

Use the [comparison operator](http://php.net/manual/en/language.operators.comparison.php) instead:

```
if($AvgReviews == 1){
    echo '1star';
}

```