Skip to content
Discussion options

You must be logged in to vote

Well... that logic doesn't belong in the controller any more than it belongs in the view.

Looping over one set of DB data to then get another set of DB data is a bit of an anti-pattern as well. See https://stackoverflow.com/questions/97197/what-is-the-n1-selects-problem-in-orm-object-relational-mapping as a starting place for reading up on that.

At a minimum, push the loop and the four highlighted lines back into the model where they belong. Probably in ProjectLogs class by the looks. Try to write one query that encompasses all the data fetched by the original call that returns the data in getProjectLogsInfo (not a good variable name for a recordset btw: lose the get (it makes it sound li…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cfcoder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants