Welcome Guest, Not a member yet? Register   Sign In
Can we run queries in the Helper classes
#1

[eluser]NEHIL[/eluser]
hi,
i wanted to know whether we can query the database in old procedural style to the database or do we need to go via some model while defining a function in the helper class.
#2

[eluser]WanWizard[/eluser]
CI in the end is just PHP, so offcourse you can. But I would advise you not to do it.
#3

[eluser]mihaibaboi[/eluser]
You can do it, but I advise you to think very carefully about it. In doing so, you go against the MVC pattern and you make you code very hard to maintain. If you come to the conclusion that it's a must, do it, it's not a crime. But try to use best practices as often as you can.
#4

[eluser]InsiteFX[/eluser]
As the other users have mentioned to you it is bad practice in MVC!

Whats wrong with using a Model for your queries?

Thats where they should be.

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB