Question: In PHP , mySQL How do I change $question _ id into $question _ text? Code: In PHP: foreach ( $ _ POST as $question

In PHP, mySQL How do I change $question_id into $question_text?
Code:
In PHP:
foreach($_POST as $question_id=>$answer)
{
//echo "inside post loop";
foreach ($rows as $row)
{
//var_dump($row);
// echo "looping rows";
if($question_id == $row['questions_id'])
{
//found the right answer, so check the values are the same
if($answer == $row['text'])
{
//User answer was correct
array_push($display_results, "$question_id, $answer : Correct!");
$score++;
}
else{
//User answer was not correct
$is_correct_ans = $row['text'];
$display_results[]="$question_id, $answer : Wrong! The correct answer was $is_correct_ans";
}
}
}
}
?>
In html:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!