In nearly all cases, all you need to do is use normal CGI programming, then load up a hash with values that you got from your mysql database; this hash is then passed to the template module, which fills in the template form, and either prints it to STDOUT or returns it as a string after which you can print it out to whereever. For example, with TT2, you could call your template as such:
and then in 'mytemplate.html', you'd have placeholders as such:print $tt2obj->process( 'mytemplate.html', { title => 'Matrix', image => 'matrix_cover.jpg', desc => 'This is a cool movie with CGI effects' } );
The various template solutions allow for much more control of the output and allow for looping and if-then constructs as well.<H2>[% title %]</H2> <IMG SRC="[% image %]" alt="[% title %]"> <P> [% desc %] </P>
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important
In reply to Re: Movie-database (mysql) with browser interface
by Masem
in thread Movie-database (mysql) with browser interface
by khippy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |