Gossamer Forum
Home : Products : DBMan : Discussions :

how to get exact category vs. category containing match?

Quote Reply
how to get exact category vs. category containing match?
I'm trying to integrate DBMan with Links 2.0 to create an alphebetical listing for specific categories (so you can list records with Titles starting with A B C D E .... X Y Z for each major category.)

I'm thinking of simply setting up links to DBMan in the format

http://mydomain.com/cgibin/db.cgi?uid=default&db=default
&view_records=1&Category=CategoryNameA&Title=^A&re=on&sb=1&so=ascend&nh=1

However I have one problem: I want to display records in each large category, but no in it's subcategories.

So for the above link, I want DBMan to single out records in Category=CategoryNameA but not include records in Category=CategoryNameA/Subcat1 and Category=CategoryNameA/Subcat2 etc. (In Links 2 subcategories are defined as the main category name / subcategory.) How can I get this exact match on the category name, without modifying the database itself?

Thanks.

(Edit: I don't know how to keep the forum from changing the "&" into &)

Last edited by:

marinedesign: Dec 18, 2001, 7:32 PM
Quote Reply
Re: [marinedesign] how to get exact category vs. category containing match? In reply to
Thanks to a post by AstroBoy the solution is in the mysterious yet ever powerful realm of regular expressions.

To search for MainCategory and not also turn up MainCategory/Sub the solution is to search for MainCategory$ (the dollar sign limits it).
Quote Reply
Re: [marinedesign] how to get exact category vs. category containing match? In reply to
Actually, just add "ww=on" to the query-string. When "whole words" is on, you should only get exact matches.
kellner