Hi Monks!
I am trying to process a MySQL query and send the results to the browser using Template Toolkit. It is my understanding that TT2 will only handle lists and hashes. I have opted to use a hash.
My query requires that I pass several records of data to the browser. I am trying to loop fetchrow_array() to to process each record to see if there is a match (my query includes a filtered search). If there is a match, I need to retrieve several columns of data from that record. So I have multiple pieces of data and multiple records to deal with.
Normally, I would format and print these results to the browser as part of the query. However, TT2 requires me to send this information to the browser via a template (as I'm sure you know). So it seems like I have to build a hash. I can write code to do this using all the scalar data, but I'm wondering if there is an easier (preferred) way to process this query. Seems like a lot of work (especially when TT2 makes so many other things so easy to do). Did I mention I have little experience using TT2?
What is the best way to do this?
Thanks for your time.
In reply to Best way to send records to the browser? by Perobl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |