Closed jogratna closed 5 years ago
Just check out the documentation seriously https://medoo.in/api/select. The conditions and LIMIT/ORDER
are together in the same array.
[
"AND" => [
"flduid" => $uid,
"fldstock_id" => $data["fldstock_id"],
"fldtype" => 1
],
"LIMIT" => [0,1],
"ORDER" => ["flddate" => "DESC"]
]
Describe the bug A clear and concise description of what the bug is. simple where clause with order by and limit don't work. There is serious bug in the code. Information
Detail Code $transacts=$_dbObj->debug()->select("tbltransactions","fldrate", [ "AND" => [ "flduid" => $uid, "fldstock_id" => $data["fldstock_id"], "fldtype" => 1 ]],[ "LIMIT" => [0,1], "ORDER" => [ "flddate" => "DESC" ] ] );
gives this output;
SELECT
fldrate
FROMtbltransactions
WHERE (flduid
= 1 ANDfldstock_id
= 1 ANDfldtype
= 1)Expected output
SELECT
fldrate
FROMtbltransactions
WHERE (flduid
= 1 ANDfldstock_id
= 1 ANDfldtype
= 1) ORDER BY 'flddate' DESC LIMIT 0,1