Gossamer Forum
Quote Reply
Selecting via Template
I have a custom table with 2 columns:

Info
Type (a select: Long_Text, Short_Text)

I can display any text entry with this random global:

Code:
sub {
my $tbl = $DB->table('TRandomText');
$tbl->select_options('ORDER BY RAND()','LIMIT 1');
my $item = $tbl->select()->fetchrow_hashref;
return $item->{Info};
}

but how to display only, say Short_Text by specifying this in the template?

So something like - <%Rand_Text('Short_Text')%>

Complicated?

~ ERASER


Free JavaScripts @ Insight Eye
Subject Author Views Date
Thread Selecting via Template Eraser 1765 Mar 7, 2008, 10:55 AM
Post Re: [Eraser] Selecting via Template
Andy 1703 Mar 7, 2008, 11:02 AM