I don't know why, but I can't seem to find an answer to this anywhere -- the mySQL documentation isn't very enlightening. I just want to do an AVG query, and get the results of that query. That's all! What's wrong with the below:
$avgquery = mysql_query("SELECT AVG(rating) as avg_rating FROM fanfiction_reviews WHERE sid = '$stories[sid]' GROUP BY sid");
if($avg_rating > 0.5)
$ratingpics = "<img src=\"images/like.gif\">$avg_rating";
else
$ratingpics = "<img src=\"images/dislike.gif\">$avg_rating";
I try to print out what $avg_rating is, and get nothing -- I've tried this several different ways, and either get resource id errors, or nothing. Help?