CodeIgniter Forums
Can I improve on this query handling? - 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: Can I improve on this query handling? (/showthread.php?tid=49517)



Can I improve on this query handling? - El Forum - 02-22-2012

[eluser]meigwilym[/eluser]
I've got a simple blog engine with posts comments and tags.

My model calls in a post and also gets its comments and tags. For each post a number of records are retrieved depending on the amount of comments and/or tags.

I've got a loop going that returns a more usable array, but I'm sure there's a better way.

Here's the code http://snipt.org/uSR4#expand

I find the overwrting of the post data every time very wasteful - is there a better way?

Many thanks,

Mei