Gossamer Forum
Quote Reply
SQL Wildcard Query
Using a [charlist] Wildcard query I get no results although I'm sure the query is valid:

Code:
$sth = $link_db->select ( { CategoryID => $fidlb}, GT::SQL::Condition->new ('Links.Title', 'LIKE', '[abc]%'), VIEWABLE);

Results show with a single query ok:

Code:
$sth = $link_db->select ( { CategoryID => $fidlb}, GT::SQL::Condition->new ('Links.Title', 'LIKE', 'a%'), VIEWABLE);

What am I doing wrong?

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] SQL Wildcard Query In reply to
What does the query look like when you do this?

Code:
print $sth->query;

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] SQL Wildcard Query In reply to
I ended up using REGEXP.

So, using this, it works just great:

Code:
$sth = $link_db->select ( { CategoryID => $fidlb}, GT::SQL::Condition->new ('Links.Title', 'REGEXP', '^[0-9]'), VIEWABLE);

~ ERASER


Free JavaScripts @ Insight Eye

Last edited by:

Eraser: Jun 11, 2010, 7:42 AM