Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
looking for LIMIT $start, $limit
  • I've been a while searcing to generate "LIMIT $start, $limit" with ORM.
    I only found method limit($limit) but not with start parameter.
  • Depending on how you would like to use it. For chaining, the ORM just uses the database class: http://fuelphp.com/docs/classes/database/usage.html#filtering. If you use an options array, the structure is similar.
  • There's offset & limit which can be used in both array querying & method chaining:
    // Method chaining
    $result = Model_Example::query()->limit(20)->offset(40)->get();
    
    // Query with array
    $result = Model_Example::find('all', array('limit' => 20, 'offset' => 40));
    
  • thanks..
    method "offset()" solve my problem.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion