Skip to content
bonsak edited this page Nov 20, 2012 · 1 revision

total_found()

Fetch the total amount of rows found by the last call to find(), regardless of 'limit' parameter set. This is different than the total number of rows limited by the current call, which you can get with total().

public function total_found ()

Returns

(int) Number of rows returned by find(), regardless of the 'limit' parameter

Example

<?php
    // Pod is 'rabbits' Pod and it has 8 records

    // Let's get 3 items ordered by name
    $params = array(
        'limit'   => 3,
        'orderby' => 't.name'
    );

    $rabbits = pods( 'rabbits', $params );
?>

total_found(): <?php echo $rabbits->total_found(); ?>
total(): <?php echo $rabbits->total(); ?>

The above example will output:

total_found(): 8
total(): 3

Available Since Version

2.0+

Source File

total_found() is located in /pods/classes/Pods.php

See Also