Im having a small problem with an IF statement, maybe ive been looking at it to long and can't figure it out. so i need a little help. thanks
if ($avg[1] == 0)
$avg_output = "No one has rated $prog_data[1] yet";
else
if (($avg[0] == 1)) {
$avg[0] = "1 star";
}
if (($avg[0] <= 2) and ($avg[0] != 2)) {
$avg[0] = "2 star";
}
else if (($avg[0] <= 10) and ($avg[0] > 10)) {
$avg[0] = "under 10";
}
$avg_output = "$avg[1] users have rated $prog_data[1] an average of $avg[0] out of a possible 5";
Im trying to get $avg[0] to display the above text depending on rating. but i keep getting the output which is 2.