Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [assombracao] Show relational field

Quote Reply
Re: [assombracao] Show relational field In reply to
I am not completely sure what you want, but the following Template global might help:
Code:
sub {
#-------------------------------------------------------------------
# Get description field from table
# $table : table, $id: pk; $desc: description field
#
my ($table, $id, $desc) = @_;
($table and $id and $desc) or return;
my $tags = GT::Template->tags;
my $home = $tags->{home};
my $rs = $home->{sql}->table($table)->get($id,[$desc]);
return $rs->{$desc};
}
Call it with the table name, the id of the entry en the column name you need like this
Code:
<%show_description('Users',$userid,'fullname')%>
Is that what you need?

Jasper

BTW Why did you repost this entry in a new thread?

http://www.bookings.org
Subject Author Views Date
Thread Show relational field assombracao 5423 Nov 12, 2002, 11:46 AM
Thread Re: [assombracao] Show relational field
604 5335 Nov 12, 2002, 1:28 PM
Thread Re: [TheStone] Show relational field
assombracao 5308 Nov 13, 2002, 5:08 AM
Thread Re: [assombracao] Show relational field
604 5302 Nov 13, 2002, 9:41 AM
Thread Re: [TheStone] Show relational field
assombracao 5299 Nov 13, 2002, 11:35 AM
Thread Re: [assombracao] Show relational field
604 5293 Nov 13, 2002, 11:47 AM
Thread Re: [TheStone] Show relational field
assombracao 5300 Nov 13, 2002, 12:31 PM
Thread Re: [assombracao] Show relational field
604 5294 Nov 13, 2002, 12:57 PM
Post Re: [TheStone] Show relational field
assombracao 5291 Nov 13, 2002, 2:01 PM
Thread Re: [TheStone] Show relational field
assombracao 4951 Nov 6, 2003, 5:53 PM
Post Re: [assombracao] Show relational field
assombracao 4921 Nov 19, 2003, 3:09 AM
Thread Re: [assombracao] Show relational field
jaspercram 5273 Nov 15, 2002, 3:49 PM
Post Re: [jaspercram] Show relational field
assombracao 5251 Nov 16, 2002, 8:26 AM