CodeIgniter Forums
DRY database stuff - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: DRY database stuff (/showthread.php?tid=55023)



DRY database stuff - El Forum - 10-06-2012

[eluser]the_unforgiven[/eluser]
Hi all,

What is the best way to CRUD into different tables into the database without having to keep repeating myself?

I have seen some database libs kicking about but not sure how they work, can some explain this and what is the best way to achieve this?


DRY database stuff - El Forum - 10-06-2012

[eluser]solid9[/eluser]
Learn MY_Model.

http://codeigniter.tv/





DRY database stuff - El Forum - 10-06-2012

[eluser]jmadsen[/eluser]
Joost's video tutorial is an excellent way to understand them: http://codeigniter.tv/

Jesse Terry has written a nice one: https://github.com/jesseterry/CodeIgniter-CRUD-Model

Jamie Rumbelow has as well: https://github.com/jamierumbelow/codeigniter-base-model that I wrote a brief tutorial about how to use: http://www.codebyjeff.com/blog/2012/01/using-jamie-rumbelows-my_model

Definitely choose one or build your own and always be in the habit of using it - I wish a basic default MY_Model was included in CI & taught as the standard way to start coding projects