Please don't flame me if I butchered the perl DBI.

I didn't feel like going back and digging through a custom SQL engine to find
the select routine I made to try and remember how it works :P

It's really neat tho.  I just do a use SQL; and then I can simply go

select_many("item","blah","dill-yo",  "table"); and get those items from
"table" :D

Object Oriented Programming, mmmmmm....

S.T.O.U.T. = Synthetic Technician Optimized for Ultimate Troublshooting
----- Original Message ----- 
From: "Dennis Stout" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, June 29, 2003 22 46
Subject: Re: Re: dynamic update part of a table


> > > my $news = (sql query code goes here...);
> > >
> > > my $template = HTML::Template->new(
> > >   filename => "$Template_Dir/$tmpl_file",
> > > die_on_bad_params => 0,
> > > );
>
> Sorry, guess I forgot to change $Template_Dir/$tmpl_file to
> "your_html_file.tmpl".
>
> In your table cell, put exactly this:
>
> <TMPL_VAR NAME="NEWS">
>
> then direct your users to a CGI script of the sort of what I mentioned
before.
> I'll rewrite it now that I'm not hastly cut & pasting..
>
> #!/usr/bin/perl
> use strict;
>
> use HTML::Template;
> use DBI;
>
> $dbh = DBI->new("DBI:mysql:news;host=localhost",
>   "db_username",
>   "db_password",
>   { RaiseErrors => 1, AutoCommit =>1}
> );
>
> my $sth = $dbh->prepare("SELECT * FROM NEWS WHERE DATE=20032906");
> my $news = $sth->execute;
>
> my $template = HTML::Template->new(filename => "your_html_file.tmpl");
> $template->param(NEWS => $news)
> return $template->output();
>
> Users will have to browse to the cgi script of course....
>
> Dennis
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to