Group By
Group By
The way to made a simple group by in ivory just need some easy steps.
Example
require_once('Operations.php');
$ivoryOrm = new Operations();
$arrSelect[] = "COUNT(id)";
$arrSelect[] = "country";
$tables[] = "users";
$groupBy[] = "country";
//the method select creates the query : SELECT COUNT(id),country FROM users GROUP BY country;
$select = $ivoryOrm->select($arrSelect, $tables);
$select = $ivoryOrm->groupBy($select, $groupBy);
//the method runQuery is responsible to literally run your query into the database;
$result = $ivoryOrm->runQuery($select);