Gossamer Forum
Quote Reply
Weird...
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...

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? Crazy


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!
Subject Author Views Date
Thread Weird... Andy 2122 Feb 27, 2003, 7:02 AM
Thread Re: [Andy] Weird...
Paul 2060 Feb 27, 2003, 7:56 AM
Thread Re: [Paul] Weird...
Andy 2052 Feb 27, 2003, 8:02 AM
Post Re: [Andy] Weird...
Paul 2042 Feb 27, 2003, 8:05 AM
Thread Re: [Andy] Weird...
Alex 2033 Feb 27, 2003, 10:41 AM
Post Re: [Alex] Weird...
Andy 2043 Feb 27, 2003, 10:57 AM