Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Array display on page??

Quote Reply
Array display on page??
In a database, I fetch a series of data from an unrelated SQL table (Patients) and I would like to use that data on my template page. I created a script that will go get the data like this:

sub PatientData {
#--------------------------------------------------------------------
# Lookup data in another database.
#
my $tags = GT::Template->tags;
my $id = $tags->{PatientID};
my $info = $tags->{home}->{sql}->table('Patients')->get ($id);
return $info;
}

I can call the script from the template but how do/can I reference the individual fields of this HASH in my template? (eg. to get the individual hash elements) Maybe I'm doing this all wrong? Unsure
Quote Reply
Re: [LanceWilson2] Array display on page?? In reply to
You should just be able to use the key name as a tag, eg..

<%PatientID%>
Quote Reply
Re: [Paul] Array display on page?? In reply to
Oh... Man! They need to make that more complicated. Because when it works just like you would expect it then where's the fun! Thank you.. my bad. Crazy