[Dbix-class] Getting a' count' value

Peter Rabbitson rabbit+dbic at rabbit.us
Thu May 14 12:24:13 GMT 2009


Emmanuel Quevillon wrote:
> Hi,
> 
> Sorry if my question looks stupid, but I'd like to retrieve the
> value of a count returned by an SQL query.
> 
> I tried different things but it always return 1
> 
> Here is the way I'd like it to work:
> 
> ...
> acc => $g->name(),
> num => $c->model('Table')->search({'id' => $g->id},<CODE>
> 
> where I tried to replace <CODE> with :

Ever tried search()->count ? :)



More information about the DBIx-Class mailing list