catfan / Medoo

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

Select GROUP ordering issue #446

Closed fpswebmaster closed 7 years ago

fpswebmaster commented 8 years ago

Medoo V = 1.1.2

When doing a ORDER function, you cannot pass along the direction it should order by

It returns a FALSE statement. Checking LINE 493 I can clearly see its not being passed as an array ... and when I FAKE it being an array the "$stack[] = $this->column_quote($column) . ' ' . $value;" does not function.

Below is the example SELECT statement I am running.

EX:

<!--BREAKS-->
$techs = $this->medoo()->select("stat_technicians", // DB Table
    ["id","l_name"], // DB Columns
    ["ORDER" => "l_name ASC"]
);

<!--WORKS-->
$techs = $this->medoo()->select("stat_technicians", // DB Table
    ["id","l_name"], // DB Columns
    ["ORDER" => "l_name"]
);

UPDATE
<!--WORKS ... But doesn't SORT-->
$techs = $this->medoo()->select("stat_technicians", // DB Table
    ["id","l_name"], // DB Columns
    ["ORDER" => "stat_technicians.l_name ASC"]
);
catfan commented 7 years ago

Check out the new ORDER syntax for v1.1.