catfan / Medoo

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

Query didn't correct when a column type is timestamp. #614

Closed bluestonemds closed 7 years ago

bluestonemds commented 7 years ago

this query return array(0)

$result = $this->db->select("ac_order",[ "card_num", "order_date ], [ "order_date[>]" => '2017-08-01' ]);

order_date column type is timestamp

Andrews54757 commented 7 years ago

@bluestonemds It should work: https://github.com/catfan/Medoo/blob/master/src/Medoo.php#L572-L588

bluestonemds commented 7 years ago

@Andrews54757 thank you for your help. I finally know the error how to happen. below is my query code: $result = $this->db->select("ac_order", [ "card_num", "order_date ], ["and" => [ [ "order_date[>]" => '2017-08-01' ]), ["pay"] => '1' ] ]);

it should not work. but I capitalize the 'and' to 'AND', the query worked well. the issue don't happen to the early version of MEDOO, like 1.1.2.

Andrews54757 commented 7 years ago

@bluestonemds Yes, the casing is confusing. Would be better if everything was lowercase. In fact, I am having a conversation with catfan about it here: #609