help on how to loop .. displaying all data on database.. |
[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, 03:34 AM
help on how to loop .. displaying all data on database.. - by El Forum - 01-07-2013, 04:55 AM
help on how to loop .. displaying all data on database.. - by El Forum - 01-07-2013, 05:03 AM
help on how to loop .. displaying all data on database.. - by El Forum - 01-07-2013, 06:04 AM
help on how to loop .. displaying all data on database.. - by El Forum - 01-07-2013, 06:50 AM
help on how to loop .. displaying all data on database.. - by El Forum - 01-07-2013, 07:39 PM
|