I'm just wondering. This only seems to happen on 2.1.2 ...
If I use the following code, it prints out a list of all the ID's correctly...
use strict;
use lib '/home/ameinfo/cgi-bin/events/admin';
use Links qw/$IN $DB $CFG/;
use GT::SQL;
local $SIG{__DIE__} = \&Links::fatal;
# FIRST GET ALL THE VARIABLES WE NEED....AND INCLUDE MODULES...
my $db = new GT::SQL '/home/ameinfo/cgi-bin/events/admin/defs';
my $table = $db->table ('Links');
my $sth = $table->select();
while (my $hit = $sth->fetchrow_hashref) {
print $hit->{ID} . "\n";
}
However, if I use the following code (also tried with $DB in replacement of $GT::SQL), but I then get an error saying "can't call 'table' on an undefined value"...Is it me, or shouldn't it do that?
use strict;
use lib '/home/ameinfo/cgi-bin/events/admin';
use Links qw/$IN $DB $CFG/;
use GT::SQL;
local $SIG{__DIE__} = \&Links::fatal;
# FIRST GET ALL THE VARIABLES WE NEED....AND INCLUDE MODULES...
my $table = $GT::SQL->table('Links');
my $sth = $table->select();
while (my $hit = $sth->fetchrow_hashref) {
print $hit->{ID} . "\n";
}
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!
If I use the following code, it prints out a list of all the ID's correctly...
Code:
#!/usr/bin/perl use strict;
use lib '/home/ameinfo/cgi-bin/events/admin';
use Links qw/$IN $DB $CFG/;
use GT::SQL;
local $SIG{__DIE__} = \&Links::fatal;
# FIRST GET ALL THE VARIABLES WE NEED....AND INCLUDE MODULES...
my $db = new GT::SQL '/home/ameinfo/cgi-bin/events/admin/defs';
my $table = $db->table ('Links');
my $sth = $table->select();
while (my $hit = $sth->fetchrow_hashref) {
print $hit->{ID} . "\n";
}
However, if I use the following code (also tried with $DB in replacement of $GT::SQL), but I then get an error saying "can't call 'table' on an undefined value"...Is it me, or shouldn't it do that?

Code:
#!/usr/bin/perl use strict;
use lib '/home/ameinfo/cgi-bin/events/admin';
use Links qw/$IN $DB $CFG/;
use GT::SQL;
local $SIG{__DIE__} = \&Links::fatal;
# FIRST GET ALL THE VARIABLES WE NEED....AND INCLUDE MODULES...
my $table = $GT::SQL->table('Links');
my $sth = $table->select();
while (my $hit = $sth->fetchrow_hashref) {
print $hit->{ID} . "\n";
}
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!