faster,better way to get stuff from db + add/edit theory |
[eluser]Hannes Nevalainen[/eluser]
$this->db->query() in the User Guide Take a look under "Query Bindings". =)
[eluser]codex[/eluser]
[quote author="Hannes Nevalainen" date="1217555145"]$this->db->query() in the User Guide Take a look under "Query Bindings". =)[/quote] Hmm, indeed. Though I'm in the userguide pretty much every day, I failed to see this. :-)
[eluser]InterCoder[/eluser]
I have a page with a controller called: comments and I also want to improve it's structure. It's a page in my admin control panel and it has the following actions: add, edit, view, delete. Now, I'm not quite sure if IgnitedRecord is suitable for me..?
[eluser]sophistry[/eluser]
IgnitedRecord puts a layer of abstraction between the code and the db. It's basically a "super model" that gives you some handy ways of interacting with your db and will help cut down on redundant code. The approach is called Object Relational Mapping (ORM). It's a great tool if you've started to get annoyed at the repetitive nature of coding models and you want something to help distill that away. BTW, don't use the word view as a method - it's reserved (in PHP 4 only - in PHP 5 it's ok): reserved names cheers.
[eluser]InterCoder[/eluser]
I'll check out the manual from IgnitedRecord, but still don't see the advantages of it. Can't you give me an example with the "old"-way and the "IgnitedRecord"-way?
[eluser]sophistry[/eluser]
nope. ;-) i assume you already know the "old" way because that is just the CI way and it's in the docs. the "new" way via IgnitedRecord is one of the most thoroughly documented pieces of third party CI contributions i've seen so you should have no trouble using it. but, check out the IgnitedRecord thread and you'll see. advantages are that you streamline your controller and model code for interactions with a database. if you aren't using a database or you just use the database to store very simple stuff then you probably won't see the benefit. but, if you have many db tables with joins and related tables you'll see why ignitedrecord is useful.
[eluser]neen[/eluser]
I have the following save() function in my category controller: Code: public function save() Code: public function save($data, $id = NULL) |
Welcome Guest, Not a member yet? Register Sign In |