I wasn't getting any error. I am just trying to do a simple thing as take addresses from mysql database and use H-T to print on the web. And any code from here or perl monk would work.
----- Original Message ----- From: "Brian McCain" <[EMAIL PROTECTED]> To: "Doc" <[EMAIL PROTECTED]>; "html-template-users" <[EMAIL PROTECTED]> Sent: Friday, September 27, 2002 4:31 PM Subject: Re: [htmltmpl] HTML-Template and DBI > Has anybody gotten an answer from this? I'm also curious what the error > messages were. > > There are a million different ways to connect data from DBI with > HTML::Template, and we could suggest different ways of doing it all day for > a month....or we could try to help Doc solve his specific problem. Speaking > of that specific problem...maybe you could clear it up for us Doc, exactly > what is it that you are trying to do? The more detailed the question, the > higher chance of an accurate (and applicable) solution. > > Brian McCain > PageMasters Internet Group > > ----- Original Message ----- > From: "Jim Lang" <[EMAIL PROTECTED]> > To: "html-template-users" <[EMAIL PROTECTED]> > Sent: Friday, September 27, 2002 7:40 AM > Subject: Re: [htmltmpl] HTML-Template and DBI > > > | Doc wrote: > | > | >None of the code at PerlMonks worked for me. At least, ones I the > simplier ones. > | > > | > > | > | what error messages did you get? > | > | > > | > > | > > | > > | > > | >----- Original Message ----- > | >From: "Jim Lang" <[EMAIL PROTECTED]> > | >To: <[EMAIL PROTECTED]> > | >Sent: Thursday, September 26, 2002 6:04 PM > | >Subject: Re: [htmltmpl] HTML-Template and DBI > | > > | > > | >>Doc I think I understand your confusion... > | >> > | >>Without doubt it was the PerlMonks tutorial at > | >>http://perlmonks.thepen.com/65642.html > | >> > | >>that actually allowed me to use DBI and HTML::Template > | >>together. > | >> > | >>But I still had a problem with this part: > | >> > | >># prepare a data structure for HTML::Template > | >>my $rows; > | >>push @{$rows}, $_ while $_ = $sth->fetchrow_hashref(); > | >> > | >># instantiate the template and substitute the values > | >>my $template = HTML::Template->new(filename => 'songs.tmpl'); > | >>$template->param(ROWS => $rows); > | >> > | >> > | >>Yes, it got the data out and put it into the template, but > | >>I didn't like the fact that I didnt have a value, lets say $title, > | >>to use. See, I was used to doing a select, and then a while loop > | >>in which I would output html, so I could just write html freely, > | >>and have $column_name variables for the data output. This is pretty > | >>much what you do inside the tmpl_loop. > | >> > | >>But you only see that in the template file. Again from the > | >>PerlMonks tutorial at http://perlmonks.thepen.com/65642.html > | >> > | >> > | >><!-- songs.tmpl --> > | >><html> > | >><head> > | >><title>Song Listing</title> > | >></head> > | >><body> > | >><h1>My Songs</h1> > | >><table> > | >><!-- TMPL_LOOP NAME=ROWS --> > | >> <tr> > | >> <td><!-- TMPL_VAR NAME=TITLE --></td> > | >> <td><!-- TMPL_VAR NAME=ARTIST --></td> > | >> <td><!-- TMPL_VAR NAME=ALBUM --></td> > | >> <td><!-- TMPL_VAR NAME=YEAR --></td> > | >> </tr> > | >><!-- /TMPL_LOOP --> > | >></table> > | >></body> > | >></html> > | >> > | >>and there are your column names. > | >> > | >>But I still find this awkward sometimes when I would prefer to > manipulate > | >>the data prior to spitting it out to the template. I find myself > resorting > | >>to javascript when faced with this... I'm sure there is a better way. > | >> > | >>Well hopefully I've added something to the discussion besides more > | >>confusion.. > | >> > | >>Jim > | >> > | >> > | >> > | >> > | >> > | >>------------------------------------------------------- > | >>This sf.net email is sponsored by:ThinkGeek > | >>Welcome to geek heaven. > | >>http://thinkgeek.com/sf > | >>_______________________________________________ > | >>Html-template-users mailing list > | >>[EMAIL PROTECTED] > | >>https://lists.sourceforge.net/lists/listinfo/html-template-users > | >> > | > > | > > | > > | >------------------------------------------------------- > | >This sf.net email is sponsored by:ThinkGeek > | >Welcome to geek heaven. > | >http://thinkgeek.com/sf > | >_______________________________________________ > | >Html-template-users mailing list > | >[EMAIL PROTECTED] > | >https://lists.sourceforge.net/lists/listinfo/html-template-users > | > > | > | > | > | > | > | ------------------------------------------------------- > | This sf.net email is sponsored by:ThinkGeek > | Welcome to geek heaven. > | http://thinkgeek.com/sf > | _______________________________________________ > | Html-template-users mailing list > | [EMAIL PROTECTED] > | https://lists.sourceforge.net/lists/listinfo/html-template-users > | > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Html-template-users mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/html-template-users ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Html-template-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/html-template-users
