Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select
Ben aşağıda listelenen uyarı olsun ve ben bunu düzeltmek nasıl merak ediyorum
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given on line 65
Kod aşağıda listelenen PHP kodu bu bölümde civarındadır. Gerekirse ben tam kodu listeleyebilirsiniz.
// function to retrieve average and votes
function getRatingText(){
$dbc = mysqli_connect ("localhost", "root", "", "sitename");
$sql1 = "SELECT COUNT(*)
FROM articles_grades
WHERE users_articles_id = '$page'";
$result = mysqli_query($dbc,$sql1);
$total_ratings = mysqli_fetch_array($result);
$sql2 = "SELECT COUNT(*)
FROM grades
JOIN grades ON grades.id = articles_grades.grade_id
WHERE articles_grades.users_articles_id = '$page'";
$result = mysqli_query($dbc,$sql2);
$total_rating_points = mysqli_fetch_array($result);
if (!empty($total_rating_points) && !empty($total_ratings)){
$avg = (round($total_rating_points / $total_ratings,1));
$votes = $total_ratings;
echo $avg . "/10 (" . $votes . " votes cast)";
} else {
echo '(no votes cast)';
}
}