V
V
vitalykostak2019-02-02 22:49:21
PHP
vitalykostak, 2019-02-02 22:49:21

Why does the R::find method in ORM ReadBeanPHP always return one record?

Given variable: $cities_of_region = R::find ('city', '`id_region` = ?', array(;id_region));
Always returns only one record, and always the last one (ie if it was supposed to return 100 records, it returns the last one in alphabetical order)
Perhaps someone knows what to do with this? I can't find the answer anywhere.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Kalinin, 2019-02-02
@kentovsky

You should probably write it correctly, for example:

$id_region = 123;
$cities_of_region = R::find ('city', 'id_region = ?', [$id_region]);

or if looking for only one entry use R::findOne();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question