Source of: /ADI/displayTable_mysql/filmes6.php
<?php
require_once "HTML/Template/IT.php";
include 'inc/db.inc';
function displaySelect($result)
{
$template = new HTML_Template_IT('.');
$template->loadTemplatefile('filmes6_templateIT.html', true, true);
$nrows = mysql_num_rows($result);
if( $nrows > 0 ) {
for($i=0; $i<$nrows; $i++) {
$tuple = mysql_fetch_array($result,MYSQL_ASSOC);
$nomeActor = $tuple["nomeactor"];
$template->setCurrentBlock("NOMES");
$template->setVariable('NOME', $nomeActor);
$template->parseCurrentBlock();
} } $template->show();
}
$db = dbconnect($hostname,$db_name,$db_user,$db_passwd);
if($db) {
$query = "SELECT DISTINCT nomeactor FROM participa";
if(!($result = @ mysql_query($query,$db )))
showerror();
displaySelect($result);
mysql_close($db);
} ?>