Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Filtering searches using database fields.

Quote Reply
Filtering searches using database fields.
I'm using mysql indexing and I would like to search a database where the value of a field, for example LinkID, is 1. At the moment I'm using search.cgi?query=whatever&LinkID=1 However, this is generating a search for LinkID LIKE %1% which is obviously not what I want. I've tried adding ww=1 but this doesn't seem to make any difference. Any ideas how I can get it to search for exact terms?

Thanks,
Laura.
The UK High Street
Quote Reply
Re: [afinlr] Filtering searches using database fields. In reply to
Hi,

Mmm.. shouldn't it be ID=xxx ?

Also, have you tried the -opt format?

i.e;

LinkID=xx;LinkID-opt==

(not 100% sure what th URL encoded value for = is (but it should be %22 (or similar). i.e;

LinkID=xx;LinkID-opt=%22

AFAIK, this function is available in search.cgi, as well as admin record searches.

Hope that helps.

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] Filtering searches using database fields. In reply to
Hi Andy,

Thanks for trying - but unfortunately neither of these seem to make any difference. Try searching on my site for shop and setting ID=1 - it returns all links that contain 1 in their ID.

Laura.
The UK High Street
Quote Reply
Re: [afinlr] Filtering searches using database fields. In reply to
Hi,

Yeah, I see the problem. After some playing, this works;

http://www.theukhighstreet.com/perl/search.cgi?query=;ID=1;ID-opt=%3D

Hope that helps Smile

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] Filtering searches using database fields. In reply to
Ooo - so close! I thought you'd got it then.

I need to be able to search for things in a database and limit the search to items where an ID field is a certain number. If I put a word in for the query the above link still does a LIKE search on the ID field.

Very frustrating. Thanks for trying.

Laura.
Quote Reply
Re: [afinlr] Filtering searches using database fields. In reply to
Mmm.. really? :/ (your site is going too slow for me... was hanging for about 3 mins :/).

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] Filtering searches using database fields. In reply to
In Reply To:
(your site is going too slow for me... was hanging for about 3 mins :/).[/quote]
Mm - my server isn't coping very well at the moment - I'm thinking I might have to move the database onto a separate server. Frown