Gossamer Forum
Home : Products : DBMan SQL : Development, Plugins and Globals :

Re: [sdsouza] Problem in the globa .. extracting data from databasel

Quote Reply
Re: [sdsouza] Problem in the globa .. extracting data from databasel In reply to
Try replacing the following two lines -

use GT::Date qw/:all/;
my($tags) = shift;


with just one line -

my $tags = GT::Template->tags;

Also remove the "\" and add " ' " in the following -

my $table33 = $DB->table(\'tblClients\');
my $sth33 = $table33->select ([\'ClientID\'], {'AccountID' => $accountid});

Try the above first and let me know if it works. If not, you could also try the following (which is how I would usually write the global) -

sub {
my $tags = GT::Template->tags;
my ($clientid) = $DB->table('tblClients')->select({'AccountID' => $tags->{AccountID} }, ['ClientID'])->fetchrow_array();
return $clientid;
}

"my" is used to declare a variable before it is used. It only needs to be declared once. If you don't declare it you will get an error.

Hope that helps.

Simon.
Subject Author Views Date
Thread Problem in the globa .. extracting data from databasel sdsouza 3339 Oct 21, 2003, 4:17 PM
Post Re: [sdsouza] Problem in the globa .. extracting data from databasel
jai 3224 Oct 21, 2003, 4:59 PM