M
M
Miko132018-05-22 16:10:08
PHP
Miko13, 2018-05-22 16:10:08

How to sort in RedBeanPHP?

Good afternoon.
In stock request:

$answers = R::find('questionnaire', 'date = ?', array($date));

After which there is a loop where we use a many-to-one relationship to take values ​​from another table:
foreach ($answers as $answer) {

                $l_name = $answer->person['last_name'];
                $f_name = $answer->person['first_name'];
....
}

And then we display everything we need in the table:
<td width="25%"><? echo $l_name . ' ' . $f_name; ?></td>

In general, from the questionnaire table by id we get the last name and first name of the person from the person table.
How can I sort people alphabetically, and is it possible?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question