You are here: More help with templates please « PHP Programming Language « IT news, forums, messages
More help with templates please

Posted by Phil Latio on 05/12/05 17:30

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>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация