Posted by GamblerZG on 11/06/05 01:41
Leonard Burton wrote:
> [[tag with db query]]
> <table>
> <tr><td>colname</td><td>colname</td><td>colname</td></tr>
> <tr><td>%var1%</td><Td>%var2%</td><td>%var3%</td></tr>
> </table>
> [[/tag with db query]]
>
> I would like it to be able to parse the line with the %var1% (which is
> the column name with % or some other indicator on each side) in it and
> then have it generate how many ever rows as nessecary.
>
> Currently, my parsing engine loads the template, preg_splits() it so
> each template tag is on a new line, and then passes through the
> resulting array and executes the code for whatever tag is chosen.
Why don't you use PHP itself?
//db query
?>
<table>
<tr><td>colname</td><td>colname</td><td>colname</td></tr>
<?php
foreach ($row = query($result)) {
echo
"<tr><td>$row[var1]</td><Td>$row[var2]</td><td>$row[var3]</td></tr>";
}
?>
</table>
<?php
db query
--
Best regards,
Roman S.I.
http://sf.net/projects/naturalgine/
[Back to original message]
|