catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.84k stars 1.15k forks source link

Just use the raw object with two parameters. #969

Closed xiasha11 closed 3 years ago

xiasha11 commented 3 years ago

Just use the raw object with two parameters.

'date' => Medoo::raw("BETWEEN to_date(:today1, 'YYYY-MM-DD') AND to_date(:today2, 'YYYY-MM-DD')",  [
    ':today1' => $today1,
    ':today2' => $today2
])

Originally posted by @catfan in https://github.com/catfan/Medoo/issues/967#issuecomment-846370648

xiasha11 commented 3 years ago

SELECT * FROM reporttata_user WHERE date = BETWEEN to_date('2021-05-19', 'YYYY-MM-DD') and to_date('2021-05-22', 'YYYY-MM-DD')" $database->log() 多了= 号