Welcome Guest, Not a member yet? Register   Sign In
help on how to loop .. displaying all data on database..
#5

[eluser]Rowan Wilson[/eluser]
Quote:sir how about if i want 5 items only to be display.. ??

In your model:

Code:
$query = $this->db->query("SELECT * FROM film WHERE film_id = film_id ORDER by film_id DESC LIMIT 5");

Have a look into Active Record though. Unless your query is massively complicated it will do all that you require:

http://ellislab.com/codeigniter/user-gui...ecord.html

That way you can pass through the limit from your controller/view. If you so wish.


Messages In This Thread
help on how to loop .. displaying all data on database.. - by El Forum - 01-07-2013, 06:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB