Gossamer Forum
Quote Reply
What am I doing wrong?
Argh..this is a pain! I'm trying to write a global, so that an icon is only shown if the owner of the link, has their username set to 'isPro' in the links_Users table.

At the moment I have;

Code:
sub {

# check if a user is a pro...
my $check_user = shift;
print $check_user . "<BR>";
my $isPro;

my $table = $DB->table('Users');
my $sth = $table->select( { Username => $check_user } );

while (my $hit = $sth->fetchrow_hashref) {

$isPro = $hit->{isPro};

} # end while...

return $isPro;

}

For some reason, this is printing out;

HASH(0x86d155c)
admin
HASH(0x86a3a88)
admin
HASH(0x8706cf0)
admin

This is coming from print $check_user . "<BR>";, but the problem is that this HASH() thing keeps appearing Unsure I am using;

<%if check_pro($Username)%>
stuff here]
<%endif%>

to try call the global....can anyone see why it wont work? I've been fumbling over this for the last few hours.

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!
Subject Author Views Date
Thread; hot thread What am I doing wrong? Andy 11857 Aug 20, 2002, 8:53 AM
Post; hot thread Re: [Andy] What am I doing wrong?
Ian 11341 Aug 20, 2002, 8:59 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
yogi 11443 Aug 20, 2002, 9:07 AM
Thread; hot thread Re: [yogi] What am I doing wrong?
Ian 11351 Aug 20, 2002, 9:08 AM
Thread; hot thread Re: [Ian] What am I doing wrong?
Andy 11358 Aug 20, 2002, 9:31 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
Andy 11373 Aug 20, 2002, 9:34 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
Andy 11340 Aug 20, 2002, 10:20 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
Andy 11329 Aug 21, 2002, 2:00 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
yogi 11336 Aug 21, 2002, 2:37 AM
Thread; hot thread Re: [yogi] What am I doing wrong?
Andy 11345 Aug 21, 2002, 2:45 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
yogi 11356 Aug 21, 2002, 2:48 AM
Thread; hot thread Re: [yogi] What am I doing wrong?
Andy 11326 Aug 21, 2002, 3:04 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
yogi 11386 Aug 21, 2002, 3:18 AM
Post; hot thread Re: [yogi] What am I doing wrong?
Andy 11317 Aug 21, 2002, 3:22 AM
Thread; hot thread Re: [yogi] What am I doing wrong?
Andy 11378 Aug 21, 2002, 3:32 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
PerlPod2 11280 Aug 21, 2002, 3:46 AM
Thread; hot thread Re: [PerlPod] What am I doing wrong?
Andy 11287 Aug 21, 2002, 4:14 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
PerlPod2 11308 Aug 21, 2002, 4:18 AM
Post; hot thread Re: [PerlPod] What am I doing wrong?
Andy 11256 Aug 21, 2002, 4:25 AM
Post; hot thread Re: [yogi] What am I doing wrong?
yogi 11322 Aug 20, 2002, 9:33 AM