CodeIgniter Forums
Can you not access a database in a view? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Can you not access a database in a view? (/thread-25289.html)



Can you not access a database in a view? - El Forum - 12-07-2009

[eluser]Random dude[/eluser]
I moved my db code from a view to a controller and it worked.

I know I was going completely against MVC.

Sorry for hammering the forum with heaps of newb questions.


Can you not access a database in a view? - El Forum - 12-07-2009

[eluser]Johan André[/eluser]
You should be able to but you should'nt do it.
Keep the db-access in your models...