A
A
antonmann2019-08-07 17:20:05
PHP
antonmann, 2019-08-07 17:20:05

How to make a selection by date from and to with ORM RedBeanPhp?

Good afternoon !
There is a table "bonusesstat", which stores events (statistical notes about accrued bonuses). Events have a date in the form of two cells - one is called "dateu" in unix format ( 1565183363 ) and the second is 'dateo' in the form of a classical date, only without seconds ( 2019-08-07 18:09 ).
How to select data from one table from one For example, from the 1st to the 10.
Studying the official documentation did not help to solve the problem, it was not possible to figure it out using the examples given there!
Thanks!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Siverius, 2019-08-07
@Siverius

$query = 'SELECT * FROM bonusesstat WHERE dateo BETWEEN ? AND ?';
$execParams[] = $firstDate;
$execParams[] = $lastDate;
R::exec($query, $execParam);

More or less like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question