AN-net
04-12-2004, 03:59 PM
im getting invalid argument for some reason:
heres the error
Warning: Invalid argument supplied for foreach() in /home/blah/blah/blah/quiz.php on line 140
137: $fquestions= $DB_site->query("SELECT quiz_questions.question,quiz_questions.question_id ,quiz_answers.answer,quiz_answers.correct FROM ".TABLE_PREFIX."quiz_questions LEFT JOIN quiz_answers ON (quiz_questions.question_id=quiz_answers.question_ id) WHERE quiz_questions.quiz_id='".$_REQUEST['q']."' AND quiz_questions.active='1' AND quiz_answers.active='1'");
138: while($question= $DB_site->fetch_array($fquestions))
139: {
140: foreach($question['answer'] as $answer)
141: {
142: exec_switch_bg();
143: eval('$ansbits .= "' . fetch_template('quiz_correctansbits') . '";');
144: }
heres the error
Warning: Invalid argument supplied for foreach() in /home/blah/blah/blah/quiz.php on line 140
137: $fquestions= $DB_site->query("SELECT quiz_questions.question,quiz_questions.question_id ,quiz_answers.answer,quiz_answers.correct FROM ".TABLE_PREFIX."quiz_questions LEFT JOIN quiz_answers ON (quiz_questions.question_id=quiz_answers.question_ id) WHERE quiz_questions.quiz_id='".$_REQUEST['q']."' AND quiz_questions.active='1' AND quiz_answers.active='1'");
138: while($question= $DB_site->fetch_array($fquestions))
139: {
140: foreach($question['answer'] as $answer)
141: {
142: exec_switch_bg();
143: eval('$ansbits .= "' . fetch_template('quiz_correctansbits') . '";');
144: }