下面的查询工作正常。但我怎么能select the 3 results separately 使用array_number?
我需要在array\\u编号的帮助下将3个结果正确分开。但不知道怎么做。
$records = $wpdb->get_results("
SELECT * FROM wp_rdp_participants_answers AS answ
INNER JOIN wp_rdp_game_images AS game ON game.image_id = answ.image_id
WHERE answ.game_id = $i
&& answ.answer_time LIKE \'$day%\'
AND answ.answer = game.correct_answer
ORDER BY answ.answer_time ASC
LIMIT 3", ARRAY_A);
if(count($records) > 0){
foreach($records as $rec){
echo $rec->user_id.\' - \'. $rec->answer_time.\' - \'.$rec->answer.\' - \'. $rec->correct_answer. \'<br>\' ;
}
}
How do I get now array[0] , array[1], array[2] ?