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

Change condition in code-fragment

Quote Reply
Change condition in code-fragment
Hi to all...

we have this fragment of code:

if($db->count({ Email => $args->{Email}, KS =>'500'})){

Can anybody tell me, how the syntax should be, if we change the condition into:
IF KS eq "400" OR "500"

Thanks in advance!

Quote Reply
Re: [Coyu] Change condition in code-fragment In reply to

You'd probably need to use GT::SQL::Condition. Something like;

my $cond = GT::SQL::Condition->new('KS','=','500','KS','=','400');
if($db->count({ Email => $args->{Email} }, $cond)){

Hope that helps.


Andy (mod)
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!