Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [LanceWilson2] Table and Functions

Quote Reply
Re: [LanceWilson2] Table and Functions In reply to
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.

Last edited by:

TheStone: Jan 6, 2003, 10:31 AM
Subject Author Views Date
Thread Table and Functions LanceWilson2 4586 Jan 5, 2003, 10:20 PM
Thread Re: [LanceWilson2] Table and Functions
604 4472 Jan 6, 2003, 10:28 AM
Thread Re: [TheStone] Table and Functions
LanceWilson2 4456 Jan 6, 2003, 12:54 PM
Thread Re: [LanceWilson2] Table and Functions
604 4452 Jan 6, 2003, 1:14 PM
Thread Re: [TheStone] Table and Functions
LanceWilson2 4455 Jan 6, 2003, 2:45 PM
Thread Re: [LanceWilson2] Table and Functions
604 4457 Jan 6, 2003, 2:52 PM
Post Re: [TheStone] Table and Functions
LanceWilson2 4458 Jan 6, 2003, 3:24 PM