Welcome Guest, Not a member yet? Register   Sign In
Send complex SQL string to another controller/view for print
#5

(10-07-2015, 02:14 PM)kabeza Wrote: My problem is that I don't want to copy the same code to generate the filtering sql in another controller/view just for printing the results. I'd like to find an easy/secure way to share that generated sql code between controllers/views

The safest way to do this is to move the code which generates the SQL into a library which is called by the controllers (assuming you need it to be called from multiple controllers) and just regenerate the SQL using the same inputs.

You could store the SQL in the session, but I try not to get in the habit of passing SQL strings around if I don't have to (especially storing them with the idea that I could use them again later).
Reply


Messages In This Thread
RE: Send complex SQL string to another controller/view for print - by mwhitney - 10-08-2015, 06:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB