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:

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!

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

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

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

Hope that helps.

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!