Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

...unblessed reference...

Quote Reply
...unblessed reference...
I'm trying to write a global that will grab something from the lsql_News table. I currently have;

my $table = $DB->table('News');
my $sth = $table->select_options ('ORDER BY Stamp DESC')->select( { Category => "$file" } );
my ($url,@url,@text);

...but when running the abopve code, it gives the following error;

Can't call method "select" on unblessed reference at test.cgi line 63.

I'm not quite sure what that error message means. BTW: I've also checked to see if the value is empty, but its returning what it is supposed to.

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!
Quote Reply
Re: [Andy] ...unblessed reference... In reply to
Yup because you can't use select_options like that. It doesn't return a table object so has to be called on it's own like:

$table->select_options( ... );
my $sth = $table->select( ... );
Quote Reply
Re: [Paul] ...unblessed reference... In reply to
Cheers....that sorted it out. I'm sure I have called it like that before....or maybe I'm just dreaming Unsure

Thanks again.

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!