Fragen anzeigen

END; $db = new Database(); $questions = $db->getQuestions(); //This will convert the array into objects for easier access. //The conversion is ugly but does the job (I'm used to the laravel collections) $questionsobj = json_decode(json_encode($questions), false); foreach($questionsobj as $question) { echo(""); echo(""); $color = ($question->solution == 0) ? "background-color: green" : "background-color: red"; echo(""); $color = ($question->solution == 1) ? "background-color: green" : "background-color: red"; echo(""); $color = ($question->solution == 2) ? "background-color: green" : "background-color: red"; echo(""); echo <<
END; } echo <<

Frage hinzufügen END; $db->destroy(); ?>
Frage Antwort0 Antwort1 Antwort2
$question->question$question->answer0$question->answer1$question->answer2