Run query in view rather than controller |
[eluser]Unknown[/eluser]
Hi, I need to execute a query in view rather than in controller. Can any body help me please how to call. If I call it gives the error message Severity: Notice Message: Undefined property: CI_Loader::$db Filename: views/floorplan.php Line Number: 57
[eluser]prestondocks[/eluser]
Could you provide the reason for running the query in the View. You are working outside of the Model, View, Controller framework if you put data access or too much logic in your views. We may be able to help you put the query back in the model where it should be if we understand the what you are trying to do. Simon
[eluser]smilie[/eluser]
+1 for prestondocks - do not mix queries in your view :-) Follow MVC moddel ![]() Cheers, Smilie
[eluser]Juan Velandia[/eluser]
+2 for prestondocks, there's no reason to put querys into the view... think ahead! Please check this thread, It uses mvc structure. The tables names are different but it’s easy (I think) to figure it out http://ellislab.com/forums/viewthread/149458/ hope it helps
|
Welcome Guest, Not a member yet? Register Sign In |