Gossamer Forum
Quote Reply
Adding ifnot Condition
How do I add a ifnot condition to this global. I tried Filter_Type != 'isMain' but just get errors.

sub {
# return new links
my (@links,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ("ORDER BY Add_Date DESC","LIMIT $_[0]");
$sth = $search_db->select ( { isValidated => 'Yes', Filter_Type != 'isMain' });
while (my $link = $sth->fetchrow_hashref) {
$link = Links::SiteHTML::tags('link', $link);
push@links, $link;
}
return {newitems=>\@links};
}

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] Adding ifnot Condition In reply to
To add such conditions, it's a little more complicated. You need to do something like:
Code:
$sth = $search_db->select(GT::SQL::Condition(
isValidated => '=' => 'Yes',
Filter_Type => '!=' => 'isMain'
));

Adrian

Last edited by:

brewt: Feb 21, 2007, 1:57 PM