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
Quote Reply
Re: [Eraser] Selecting via Template In reply to
Sorry, not quite sure what you want?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!