Gossamer Forum
Home : Products : DBMan : Customization :

HELP problem with exact search

Quote Reply
HELP problem with exact search
Hi there,

I have database with a field ordernr if i do a search for a number like 1415.8.1 it is not looking for this number only but also for 1415.8.10 11 12 13 14 15 etc

because the result of the search must only be the search value 1415.8.1 everthing is going wrong if these number exist in the database.

Is there a solution that the search in ordernr is exactly and not that dbman looks in the field is the value exist

Thanks
Marcel
Quote Reply
Re: [Marcel Emmen] HELP problem with exact search In reply to
Default match the whole word

If you want to make that the default, so that users have to match the whole word, take the option out of the search options subroutine and add a hidden tag to your search form.

<INPUT TYPE="hidden" NAME="ww" value="on">

-----------------

If you want to match the whole field (and not just a whole word), in sub query, replace

($in{'ww'}) and ($tmpreg = "\\b$tmpreg\\b");

with

($in{'ww'}) and ($tmpreg = "^$tmpreg\$"); ## changed to match whole word in field

Hope this gives you some ideas and options.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] HELP problem with exact search In reply to
Thanks for the solution,

I have just try it our and it seems to work fine,
I have put ww=on directly in the url link because i'm calling this option form ourside the database and not from the search form.

Marcel