Gossamer Forum
Quote Reply
Exclude from Select?
This is a typical select statement that you see in a lot of globals which will select all links that are new and validated:

$sth = $search_db->select ( { isNew => 'Yes', isValidated => 'Yes' });

How do I tweak this to select all links that are validated but exclude only those that are new?

Safe swoops
Sangiro
Quote Reply
Re: [sangiro] Exclude from Select? In reply to
Maybe isNew => 'No', isValidated => 'Yes'

Last edited by:

Payooo: May 14, 2004, 5:00 AM
Quote Reply
Re: [sangiro] Exclude from Select? In reply to
Yeah, Payoo is on the right track;

Code:
$sth = $search_db->select ( { isNew => 'No', isValidated => 'Yes' }) || return $GT::SQL::error;

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: [Payooo] Exclude from Select? In reply to
Quote:
Maybe isNew => 'No', isValidated => 'Yes'


Yup - I understand that I can do that, but I'm specifically looking for the "not equal to" equivalent of =>

Safe swoops
Sangiro
Quote Reply
Re: [sangiro] Exclude from Select? In reply to
You would need to do it via GT::SQL::Condition then...

my $cond = GT::SQL::Condition->new('Field','NOT LIKE','Yes','Field2','=','foo');
$table->select($cond) || return $GT::SQL::error;


The above should do the trick :)

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!