More help with templates please

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am still struggling to get my mind around having html templates doing the
mark-up. What do I have to change so the PHP script that will bring in the
HTML template and put the value $row in the table?



// simple PHP script that outputs just one string
require_once "DB.php";
$dsn = "pgsql://username:password@localhost/zendtestdatabase";
$db = DB::connect($dsn);
$query = "SELECT * FROM links WHERE link_id = 3";
$result = $db->query($query);
while ($row = $result->fetchRow())
 print "$row[1] <br />";

<!-- basic html template -->
<table border="1" cellpadding="1" cellspacing="1" width="95%" >

Re: More help with templates please

Quoted text here. Click to load it

hmm.. you did not tell which template mechanics (if any) you are trying to
use. There are several template engines present, and even php can be used as
one, and the answer will depend on which one you are using,

For examples how to do it with TemplateTamer see:

and only a tiny bit more advanced one:

-- / /

Site Timeline