Gossamer Forum
Quote Reply
GT::SQL::Condition help
I need some help with GT::SQL

im trying to write the following query:
Code:

SELECT * FROM glinks_Links WHERE ID = '$linkID' OR (LinkOwner = '$linkowner' AND LinkOwner <> 'admin');

heres what i have so far, but i think it might be wrong
Code:
my $db = $DB->table('Links');
my $cond1 = GT::SQL::Condition->new(
"LinkOwner", "=",$tags->{LinkOwner},
"LinkOwner", "<>", "admin");
my $cond2 = GT::SQL::Condition->new($cond1,"ID", "=",$tags->{ID});
$cond2->bool("or");
my $sth = $db->select ( $cond2 );

Can anyone confirm that this code is correct or if incorrect modify the code to make it correct.

Thanks,

Hagai
Quote Reply
Re: [hagai] GT::SQL::Condition help In reply to
Hi,

As far as I can see, that should work Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates