Hi all.
I've created a new table, "Links_Sponsors".
I'd like to create a Template Global that accesses this table, say something like:
sub {
my $acctname = 'whatever';
my $sponsor_db = $DB->table('Links_Sponsors');
my $sth = $sponsor_db->select ({ AcctName => $acctname });
my $sponsor = $sth->fetchrow_hashref;
return $sponsor;
}
(This is just an example)
How would I define the $DB->table('Links_Sponsors'); part so that the table is actually accessed? I tried just using $DB->table('Sponsors'); but that caused the entire global code to show up on the page.
Any help is appreciated.
Thanks!
Matt Glaspie
I've created a new table, "Links_Sponsors".
I'd like to create a Template Global that accesses this table, say something like:
sub {
my $acctname = 'whatever';
my $sponsor_db = $DB->table('Links_Sponsors');
my $sth = $sponsor_db->select ({ AcctName => $acctname });
my $sponsor = $sth->fetchrow_hashref;
return $sponsor;
}
(This is just an example)
How would I define the $DB->table('Links_Sponsors'); part so that the table is actually accessed? I tried just using $DB->table('Sponsors'); but that caused the entire global code to show up on the page.
Any help is appreciated.
Thanks!
Matt Glaspie