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

Selecting data where column not equal?

Quote Reply
Selecting data where column not equal?
Hi there Smile,I am using the following statement to pull some data from the database:
Code:
my $sth = $DB->table('mytable')->select({owner => $USER->{Username}, id => $rowID } );

My delema is that I don't want the rows 'where id = $rowID',
I want the rows 'where id != $rowID'.

I have searched through the forums and read through the documentation, but all I found was
information about 'larger than'('id-gt => $rowID') and 'less than'('id-lt => $rowID').


Sacrifice is not about what you lose,
it is about what you gain in the process.
Quote Reply
Re: [EZFrag] Selecting data where column not equal? In reply to
Hi,

This should work:

Code:
my $sth = $DB->table('mytable')->select( GT::SQL::Condition->new('owner','=',$USER->{Username},'id','!=',$rowID) );

Hope that helps =)

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Selecting data where column not equal? In reply to
Yes, that worked.
Thank you Andy Smile


Sacrifice is not about what you lose,
it is about what you gain in the process.