Try something like this:
foreach ($questions as $key => $question)
{
print "$question<br>\n";
print $answers[$key] . "<br>\n";
}
That should give you each question in the questions array printed out with the corresponding answer from the answers array.
You do know that the way you are building your arrays that you will only have 1 answer per question in your answers array, don't you?
If you want to have more than 1 answer (i.e. a multiple choice quiz) then you need to setup your $answers array to be a multi-dimensional array like so:
while ($row = mysql_fetch_assoc($result))
{
// Create array answers where text is associated with question_id
$answers[$row['question_id']][] = $row['text'];
}
foreach ($questions as $key => $question)
{
print "$question<br>\n";
foreach ($answers[$key] as $answer)
{
print "$answer<br>\n";
}
}