• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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