Open michinamibia opened 3 years ago
Using the grouBy function like this $db->groupBy("DATE_FORMAT(ymd, '%Y-%m')"); causes a fatal error:
$db->groupBy("DATE_FORMAT(ymd, '%Y-%m')");
Fatal error: Uncaught Exception: Unknown column 'Y' in 'group statement' query: SELECT ... DATE_FORMAT(ymd, Y-m) ...
Comparing the orderBy filter with the groupBy filter it shows that the quotation mark get's stripped.
$orderByField = pregreplace("/[^ -a-z0-9.(),`*\'\"]+/i", '', $orderByField); $groupByField = pregreplace("/[^-a-z0-9.(),* <>=!\'\"]+/i", '', $groupByField);
I fixed it for my personal installation, but was wondering if there is a specific reason? If not a pull request could be made to make the preg_replace the same for both functions.
Any word on this?
Using the grouBy function like this
$db->groupBy("DATE_FORMAT(ymd, '%Y-%m')");
causes a fatal error:Comparing the orderBy filter with the groupBy filter it shows that the quotation mark get's stripped.
I fixed it for my personal installation, but was wondering if there is a specific reason? If not a pull request could be made to make the preg_replace the same for both functions.