[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Syntax for db count query needed

Ruby Quest

12/28/2006 2:37:00 PM

can any one tell me the controller syntax for db record count?

I want to specify this mysql query syntax in controller

select count(*) from tablename where user_id=7;

what is the controller syntax similar to the above sql quert?


thanks and regards
Rubyquest

--
Posted via http://www.ruby-....

4 Answers

khaines

12/28/2006 3:18:00 PM

0

Ruby Quest

12/28/2006 3:28:00 PM

0

Thanks kirk Haines!

It works...

Thanks again
Rubyquest


--
Posted via http://www.ruby-....

khaines

12/28/2006 3:32:00 PM

0

Ruby Quest

12/29/2006 9:40:00 AM

0

NO...i used below method and it works.

@itemCount=Item.count(:all, :joins=>"my table joins goes here",
:conditions =>["my conditions goes here"];


sorry for the confusion....

Thanks
RQ


> That works for you? What ORM are you using? That was not AR syntax,
> but
> rather, syntax for the Kansas ORM.
>
>
> Kirk Haines


--
Posted via http://www.ruby-....