1
public static function getAllCount(){
$sql = "SELECT COUNT(Title) from ".self::$tablename." GROUP BY category_id";
$query = Executor::doit($sql);
return Model::many($query[0],new EventData());
}
FOREACH ---
foreach ($evcount as $c) {
}
print_r($evcount);
?>
RETORNO -----
Array
(
[0] => EventData Object
(
[name] =>
[lastname] =>
[email] =>
[category_id] => NULL
[password] =>
[created_at] => NOW()
[COUNT(Title)] => 4
)
[1] => EventData Object
(
[name] =>
[lastname] =>
[email] =>
[category_id] => NULL
[password] =>
[created_at] => NOW()
[COUNT(Title)] => 62
)
I want to give echo pulling the COUNT(title)=>
But when I echo he gives that mistake
Call to Undefined method Eventdata::COUNT()
From an alias to the count column.
– rray