Gossamer Forum
Home : Products : DBMan : Discussions :

Trouble with Searching

Quote Reply
Trouble with Searching
I am using DBMan to allow users to track a shipment. Using their order number they can get the tracking number to track their package. The problem is you can put in the number "1" and it will list all shipments that have a "1" in the order number. An example order number is 488784146. How can the search function only give results for a "perfect" match. I do not want any result to come up if it is not the correct order number.

Thanks.Cool
Quote Reply
Re: [uline] Trouble with Searching In reply to
Taken from the FAQ noted below:

If you want to match the whole field (and not just a whole word), in db.cgi sub query, comment out this line

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

and replace with:

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

Hope this works for you.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/