[PHPTAL] Table column with difference value

Krzysztof Zaleski cshyshtof at gmail.com
Sun Mar 23 23:02:58 CET 2008


Hi,

Let's assume I have a table (generated from DB) with 3 columns with daily
receipts from three shops. Fourth column is a sum of all three values (sum
is calculated by SQL query). Now, I would like to add next column showing
the difference between the sum of current day, and the value from previous
day. I tried using tal:define in various ways, but I either get the message
that some variable is redefined twice, or some variable definition is
missing. From my tests it seems that I cannot accomplish this task with
tal:define. If I could do something like tal:php :-) it would be perfect.
The whole idea is rather simple, but I don't know how to store previous
value from one row iteration to another. Any ideas?

Rgrds,
Krzysztof
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/phptal/attachments/20080323/ac94b488/attachment.htm


More information about the PHPTAL mailing list