473,385 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

More help with templates please

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?

Cheers

Phil
<?php
// 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 />";
}
$result->free();
$db->disconnect();
?>

<html>
<!-- basic html template -->
<body>
<table border="1" cellpadding="1" cellspacing="1" width="95%" >
<tr>
<th>Title</th>
</tr>
<tr>
<td><?=$row?></td>
</tr>
</table>
</body>
</html>
Jul 17 '05 #1
1 1176
"Phil Latio" <ph********@f-in-stupid.co.uk> wrote in message
news:9M*********************@fe06.news.easynews.co m...
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?


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:

http://www.templatetamer.org/index.p...emplateExample

and only a tiny bit more advanced one:

http://www.templatetamer.org/index.p...leMySqlRowList

rush
--
http://www.templatetamer.com/
http://www.folderscavenger.com/
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sam | last post by:
I would like to store html templates in a database. By using perl I would like to retrive the template ask the user to fill the template and store the whole file is template + the user data in a...
2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
14
by: Jigar Mehta | last post by:
Hye all, I am a VC++ programmer (have exp. of 2+ years).. But till now, I have never worked on templates.. I have developed whole products but never worked on templates or used them in my...
11
by: Micha | last post by:
Hello there, I think I've run into some classic c++ pitfall and maybe some of you guys can help me out. For my project I will need to use matrices and vectors and so I decided to implement them...
1
by: PengYu.UT | last post by:
Hi, I read Klaus Kreft & Angelika Langer's C++ Expression Templates: An Introduction to the Principles of Expression Templates at...
2
by: jimbo_vr5 | last post by:
Hey I think i've figured out the idea behind apply-templates. But going through the tutorial on <http://www.w3schools.com/xsl/xsl_apply_templates.asp> theres simply just something that i dont...
11
by: Zilla | last post by:
I have the following simple program. I just want to be able to do math operations (+, -, =)on Timer sublcasses, but want to handle cases where either rhs or lhs is an intrinsic value, However, the...
1
by: kaye80 | last post by:
I have an XML and XSL document. I am trying to incorporate hyperlinks throughout the XML document. I have read many of the related posts on this and other forums but I can't seem to get it right. ...
4
by: Debbiedo | last post by:
My software program outputs an XML Driving Directions file that I need to input into an Access table (although if need be I can import a dbf or xls) so that I can relate one of the fields...
74
by: copx | last post by:
In "Learning Standard C++ as a New Language" Bjarne Stroustrup claims that properly written C++ outperforms C code. I will just copy his first example here, which is supposed to demonstrate how C++...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.