Skip to main content
1 of 2
Cerad
  • 291
  • 1
  • 3

With pdo you would have:

$getStuff = $pdo->prepare('SELECT `question`, `answer` FROM `Quizzes` WHERE `questionNumber`< :questionNumber ORDER BY `questionNumber` ASC');

$getStuff->execute(array('questionNumber' => 21);

$rows = $getStuff->fetchAll();

foreach($rows as $row)
{
   $questions[] = $row['question'];
   $answers[]   = $row['answer'];
}

It's up to you to decide if removing the binding stuff makes the code any easier to read and maintain.

Cerad
  • 291
  • 1
  • 3