EllisLab text mark
Advanced Search
     
DRY database stuff
Posted: 06 October 2012 06:22 AM   [ Ignore ]
Avatar
Joined: 2011-06-09
643 posts

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?

 Signature 

Thanks,

=== Loving CI & Still Learning it…===

 
Posted: 06 October 2012 10:00 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2011-08-08
524 posts

Learn MY_Model.

http://codeigniter.tv/

 

 Signature 

Stick with it, practice it and have fun with it.

 
Posted: 06 October 2012 06:33 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2009-04-15
453 posts

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

 Signature 

Code By Jeff

Mahana Messaging Library

Problem with your query? Did you run

$this->db->last_query(); 

before you came to the forums for help?