in reply to Beginner question about displaying database contents using HTML Template
To continue jZed's example, you could assign the $aoh to a template loop (see the docs for HTML::Template):
and then create a template that looks something like this:$template->param(MY_LOOP => $aoh);
Each record in the $aoh will be output using the template structure in the loop (assuming the keys in the hash for each record include "FNAME", "LNAME", AND "PHONENUM").<TMPL_LOOP NAME="MY_LOOP"> <td><TMPL_VAR NAME=FNAME></td> <td><TMPL_VAR NAME=LNAME></td> <td><TMPL_VAR NAME=PHONENUM></td> </TMPL_LOOP>
HTML::Template is pretty slick, but you might need to experiment a bit to get the hang of it. Give it a shot and if you get stuck feel free to come back and ask more specific questions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Beginner question about displaying database contents using HTML Template
by derekash913 (Initiate) on Jul 20, 2006 at 18:12 UTC | |
by jZed (Prior) on Jul 20, 2006 at 18:23 UTC |