Hi,
Have a look at the script below:
sub GetCarrier {
my $id = shift;
my $tags = GT::Template->tags;
my $info = $tags->{home}->{sql}->table('Patients')->get($id);
return $info->{Carrier};
}
Now you can call it from the template by <%Dbsql::custom::GetCarrier('Wilson')%>. Ensure that 'id' is primary key field.
By the way, you can create a global template instead of adding a new pm file.
TheStone.
B.
Have a look at the script below:
sub GetCarrier {
my $id = shift;
my $tags = GT::Template->tags;
my $info = $tags->{home}->{sql}->table('Patients')->get($id);
return $info->{Carrier};
}
Now you can call it from the template by <%Dbsql::custom::GetCarrier('Wilson')%>. Ensure that 'id' is primary key field.
By the way, you can create a global template instead of adding a new pm file.
TheStone.
B.