+ Reply to Thread
Results 1 to 3 of 3

Thread: How can I get the number of rows in a query?

  1. #1
    lucianohoffmann is offline 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]$this->view->comentarios = $comentarios->fetchAll($where, $order, $count, $offset);[/PHP]

    in the view:
    [PHP]<?php echo $this->comentarios->_count ?>[/PHP]

    and i get this:

    Fatal error: Cannot access protected property Zend_Db_Table_Rowset::$_count in

  2. #2
    lucianohoffmann is offline Junior Member
    Join Date
    Jan 2008
    Posts
    2

    Default

    ok, I use this and worked.
    [PHP]
    count($this->comentarios);
    [/PHP]

  3. #3
    Jhorra is offline Member
    Join Date
    Jun 2007
    Posts
    36

    Default

    count() is how I always do it.

+ Reply to Thread

Similar Threads

  1. phone number validator
    By Rhino in forum Core Infrastructure
    Replies: 9
    Last Post: 01-20-2010, 07:01 PM
  2. How to set the number of photos in flickr
    By shin007 in forum Web & Web Services
    Replies: 3
    Last Post: 01-03-2010, 08:48 AM
  3. Retrieve mysql error number
    By lombras in forum Databases
    Replies: 0
    Last Post: 11-02-2008, 09:17 PM
  4. Routing with variable number of parameters
    By gilad in forum Model-View-Controller (MVC)
    Replies: 2
    Last Post: 07-11-2008, 09:32 AM
  5. Zend_Acl with arbitrary number of resources
    By ablock in forum Authentication & Authorization
    Replies: 0
    Last Post: 05-07-2008, 04:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts