Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-16-2008, 12:02 PM
Junior Member
 
Join Date: Jan 2008
Posts: 2
Default How can I get the number of rows in a query?

I know that the atribute _count stores the value, but how can I get it if it's protected? Is there another way to get this value?

in the controller:
PHP Code:
$this->view->comentarios $comentarios->fetchAll($where$order$count$offset); 
in the view:
PHP Code:
<?php echo $this->comentarios->_count ?>
and i get this:

Fatal error: Cannot access protected property Zend_Db_Table_Rowset::$_count in
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 03:01 PM
Junior Member
 
Join Date: Jan 2008
Posts: 2
Default

ok, I use this and worked.
PHP Code:
count($this->comentarios); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-22-2008, 04:49 AM
Member
 
Join Date: Jun 2007
Posts: 33
Default

count() is how I always do it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:10 PM.