catfan / Medoo

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

BETWEEN keyword support #836

Closed ZeeshanSultan closed 3 years ago

ZeeshanSultan commented 5 years ago

Describe the bug A clear and concise description of what the bug is.

Information

Detail Code

Medoo Query: $database->select("discount_offers", "*", Medoo::raw('WHERE ("'.$date.'" between start_date AND end_date) AND status = 1'));

My desired SQL Query : SELECT * FROM discount_offers WHERE ("2019-05-09" BETWEEN start_date AND end_date) AND status = 1

Expected output This Medoo Query generates the desired query as verified by debug but No output is returned from Medoo. If we run the generated query directly on MySQL it returns output as expected

catfan commented 5 years ago

https://medoo.in/api/where

[><] and [<>] is also available for datetime