I ma receiving an error stating:
Parse error: syntax error, unexpected T_VARIABLE in …. on line 599
which belongs in the line below:
foreach ($questions as $key=>$question) {
echo '<p><strong>Question:</strong> ' .htmlspecialchars($row_question['question_num'][$key]). ': ' .htmlspecialchars($row_question['question_content']$key]). '</p>' . PHP_EOL;
}
What am I doing incorrectly?
Below is code:
$question = array();
while ($selectedstudentanswerstmt->fetch()) {
$row_question = array();
$row_question['question_num'] = $detailsQuestionNo;
$row_question['question_content'] = $detailsQuestionContent;
$row_question['question_option'] = $detailsOptionType;
$row_question['question_num_answers'] = $detailsNoofAnswers;
$row_question['question_answer'] = $detailsAnswer;
$row_question['questionnum_reply'] = $detailsReplyType;
$row_question['questionnum_marks'] = $detailsQuestionMarks;
$questions[] = $row_question;
}
.................
<?php
foreach ($questions as $key=>$question) {
echo '<p><strong>Question:</strong> ' .htmlspecialchars($row_question['question_num'][$key]). ': ' .htmlspecialchars($row_question['question_content']$key]). '</p>' . PHP_EOL;
}
?>
You’re missing a bracket
should be