Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

limit() Query in Codeigniter

by
Category:codeigniter
codeigniter mysql
limit() Query in Codeigniter

Codeigniter provides a limit() method clause that is used to specify the number of records to return.

The limit() method makes it easy to code multi page results or pagination with SQL, and is very useful on large tables. Returning a large number of records can impact on performance.

Lets you limit the number of rows you would like returned by the query

$this->db->limit(15);  // Produces: LIMIT 15

 The second parameter lets you set a result offset.

$this->db->limit(10, 20);  
// Produces: LIMIT 20, 10 

0 Comments


Html code work in comment box


Related Post