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

How to say it with xxx=> 'yes'

Quote Reply
How to say it with xxx=> 'yes'
Very often i found something like this in lsql:

my $count = $cat_link->count ( { CategoryID => $root_id, isValidated => 'Yes'} );

Mots of time it is used as a query for mysql,
meaning e.g. isValidated => 'Yes' ~~~ where isValideted = 'Yes',

For some reasons i need not only an equal, i need >,< or =!
I tried it with 'isValidated','!=','No' (the same to eq, but it dont fix my problem.

Any ideas?
Quote Reply
Re: [Robert] How to say it with xxx=> 'yes' In reply to
Use GT::SQL::Condition

I've moved this post into the Links SQL forum.
Quote Reply
Re: [Paul] How to say it with xxx=> 'yes' In reply to
Could you give an example, Paul?
Quote Reply
Re: [Robert] How to say it with xxx=> 'yes' In reply to
Yes, just remember it. Here the new part:
Code:
my $root_total = $cat_link->count(GT::SQL::Condition->new ('CategoryID', '=', $cat_id,
'isValidated', '=', 'Yes',
'Stern', '<>', '0')
);

from the old one:
Code:
my $root_total = $cat_link->count(
CategoryID => $cat_id,
isValidated => 'Yes');


In the first example i could use an <> while with hashes i think i could only use the =


I really love lsql and maybe show you soon why, smile ;-)