• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Forced to run DB Query from View (Bad practice?)

#21
[eluser]Colin Williams[/eluser]
An easy guideline to follow is "never run a query inside of a loop." The same result can be obtained by running a query and then looping. In fact, when using JOIN queries, you're almost ALWAYS going to need to loop through the result and build your own data structure.

Quote:Actually, it’s a good way of creating a more modular application and reducing redundant code.

Yeah, but not the ONLY way and probably not the BEST way. We won't go there again though...


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.