Gossamer Forum
Home : Products : Gossamer Links : Discussions :

if - Corect?

Quote Reply
if - Corect?
Is this syntax logically correct:

<%if isColor eq Red or Blue%>
...
<%endif%>

--------------------------------
Privacy Software
Quote Reply
Re: [BLOOD] if - Corect? In reply to
I *think* is should be

<%if isColor eq 'Red' or isColor eq 'Blue'%>
Quote Reply
Re: [BLOOD] if - Corect? In reply to
Hey thanks!

Any idea on how to set a condition with this global snippet that says select only if not empty...

my $sth3 = $link_db->select ( { CategoryID => $child_id, isValidated => 'Yes' });

Something about not null?

--------------------------------
Privacy Software
Quote Reply
Re: [BLOOD] if - Corect? In reply to
my $sth3 = $link_db->select ( { CategoryID => $child_id, isValidated => 'Yes', 'FieldName','NOT LIKE','' });

Maybe?

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!
Quote Reply
Re: [BLOOD] if - Corect? In reply to
Just a small point - NULL and empty are different - it depends how your field is setup. You can see in mysqlman whether the blank fields are empty or null. In either case I think you'll need to use a condition (I think Andy wasn't quite awake Tongue). Something like this:

my $cond = GT::SQL::Condition->new( 'CategoryID', '=', $child_id, 'isValidated', '=', 'Yes' ,'FieldName', 'IS NOT', \'NULL', 'FieldName', '<>', '');
my $sth3 = $link_db->select ($cond);
Quote Reply
Re: [afinlr] if - Corect? In reply to
Hi thanks, yes the field is empty rather than Null. I'll give the codes a try - much appreciated.

--------------------------------
Privacy Software