catfan / Medoo

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

First column values is bigger then second colum values NOT work properly #786

Closed FirestarterUA closed 5 years ago

FirestarterUA commented 6 years ago

Medoo Query like: $links = $this->db->debug()->select("links", "*", [$isBot."[<]" => "limit_".$isBot, "ORDER" => ["created_at" => "ASC"], "LIMIT" => 100]); $isBot - is string.

Generate an sql query like: SELECT * FROM "links" WHERE "yandex" < 'limit_yandex' ORDER BY "created_at" ASC LIMIT 100

But must: SELECT * FROM "links" WHERE "yandex" < "limit_yandex" ORDER BY "created_at" ASC LIMIT 100

Quotes are not properly working

catfan commented 6 years ago

If limit_yandex is column, you should use

[
    $isBot . "[<]limit_" . $isBot,
    "ORDER" => ["created_at" => "ASC"],
    "LIMIT" => 100
]

https://medoo.in/api/where Columns Relationship section