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
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: [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