Hello everyone and as usual, thank you to anyone taking the time to read this.
I am attempting to display all of the answers relevant to a question that has been asked. I am using Kohana 3.
So far, I am able to determine which record has the highest amount of vote_points via:
$best_id = DB::query(Database::SELECT, 'SELECT id FROM answers WHERE vote_points=(SELECT MAX(vote_points) FROM answers) AND question_id ='.$question->id)->execute();
And, I gather all of my answers and display them by placing the result set in a foreach loop:
<?php foreach($question->answers->where('moderated', '=', 0)->where('deleted', '=', 0)->order_by('created_at', 'ASC')->find_all() as $answer): ?>
A bunch of display answer functions and divs~~~
I need to figure out a way to ensure that the record with $best_id is displayed first, and only once, while the rest of the answers are displayed and ordered by created_at asc.
Thank you, everyone!