<%method doctype> <%init> use DBI; use strict; use warnings; # Get Books my $q = $dbh->prepare("SELECT *,cd.id AS cid FROM Cd,person WHERE cd.artist1 = person.id ORDER BY name"); $q->execute or die "ERROR: couldn't query for CDs! " . $dbh->errstr; my $qnum = $dbh->prepare("SELECT ref FROM special WHERE thetable = 'person' AND ref =?"); [vs] CDs

[vs] CDs

% while( my $hr = $q->fetchrow_hashref ){ % if ($qnum->rows == 0) { % } else { % }; % };
<% $hr->{cid} %> <% $hr->{title} | h %><% $hr->{name} | h %><% $hr->{name} %>
<& special.mas, table=>'cd', ref=>$hr->{cid} &>
<%method kata>unmedia.phtml