`$total_records = (int) $count_query;`. Ref: http://kohanaframework.org/3.3/guide/kohana/conventions#type-casting

Also note the missing `;`

Yeah, I get "nazical" about such :smile: