Full error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\MyWebsite\poll\functions.php on line 28
Been working all day to set up some stuff in my website. Now currently working on the poll. Been stuck on this error and I don't know what to do.
That's the function that throws this:
Any help would be appreciated.
function getPoll($pollID){
$query = "SELECT * FROM polls LEFT JOIN pollAnswers ON polls.pollID = pollAnswers.pollID WHERE polls.pollID = " . $pollID . " ORDER By pollAnswerListing ASC";
$result = mysql_query($query);
//echo $query;jquery
$pollStartHtml = '';
$pollAnswersHtml = '';
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$pollQuestion = $row['pollQuestion'];
$pollAnswerID = $row['pollAnswerID'];
$pollAnswerValue = $row['pollAnswerValue'];
if ($pollStartHtml == '') {
$pollStartHtml = '<div id="pollWrap"><form name="pollForm" method="post" action="poll/functions.php?action=vote"><h3>' . $pollQuestion .'</h3><ul>';
$pollEndHtml = '</ul><input type="submit" name="pollSubmit" id="pollSubmit" value="Vote" /> <span id="pollMessage"></span></form><>';
}
$pollAnswersHtml = $pollAnswersHtml . '<li><input name="pollAnswerID" id="pollRadioButton' . $pollAnswerID . '" type="radio" value="' . $pollAnswerID . '" /> ' . $pollAnswerValue .'<span id="pollAnswer' . $pollAnswerID . '"></span></li>';
$pollAnswersHtml = $pollAnswersHtml . '<li class="pollChart pollChart' . $pollAnswerID . '"></li>';
}
echo $pollStartHtml . $pollAnswersHtml . $pollEndHtml;
}