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 10323 Aug 20, 2002, 8:53 AM
Post; hot thread Re: [Andy] What am I doing wrong?
Ian 9846 Aug 20, 2002, 8:59 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
yogi 9940 Aug 20, 2002, 9:07 AM
Thread; hot thread Re: [yogi] What am I doing wrong?
Ian 9858 Aug 20, 2002, 9:08 AM
Thread; hot thread Re: [Ian] What am I doing wrong?
Andy 9859 Aug 20, 2002, 9:31 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
Andy 9875 Aug 20, 2002, 9:34 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
Andy 9842 Aug 20, 2002, 10:20 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
Andy 9828 Aug 21, 2002, 2:00 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
yogi 9832 Aug 21, 2002, 2:37 AM
Thread; hot thread Re: [yogi] What am I doing wrong?
Andy 9846 Aug 21, 2002, 2:45 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
yogi 9857 Aug 21, 2002, 2:48 AM
Thread; hot thread Re: [yogi] What am I doing wrong?
Andy 9840 Aug 21, 2002, 3:04 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
yogi 9888 Aug 21, 2002, 3:18 AM
Post; hot thread Re: [yogi] What am I doing wrong?
Andy 9828 Aug 21, 2002, 3:22 AM
Thread; hot thread Re: [yogi] What am I doing wrong?
Andy 9884 Aug 21, 2002, 3:32 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
PerlPod2 9784 Aug 21, 2002, 3:46 AM
Thread; hot thread Re: [PerlPod] What am I doing wrong?
Andy 9786 Aug 21, 2002, 4:14 AM
Thread; hot thread Re: [Andy] What am I doing wrong?
PerlPod2 9815 Aug 21, 2002, 4:18 AM
Post; hot thread Re: [PerlPod] What am I doing wrong?
Andy 9762 Aug 21, 2002, 4:25 AM
Post; hot thread Re: [yogi] What am I doing wrong?
yogi 9828 Aug 20, 2002, 9:33 AM