One of my clients requested additional information from the Gossamer techis about modifying the search functions of DBMAN in terms of "Exact Word Matches" within and between fields. Here is the solution that he received and it works.
1) Replace the following line in the sub query routine in db.cgi file:
with the following codes:
2) In the sub-routine where you have your search form (like your sub view_search routine) in your html.pl file, you can either add a hidden field or checkbox for users to choose "Exact Word Match".
Here is how you add a hidden field:
Here is how you add a checkbox for this search option:
This should solve the problems that some users are having in terms of matching exact data/values in fields.
I have tested this mod on three different DBMAN projects and it works very nice.
To see this mod in action, go to the following URL:
www.coco.cc.az.us/cgi-bin/schedules/index.cgi?&uid=default
To see how this works, choose the following search criteria:
Subject: Computer Information Systems (CIS)
Days: Monday
If you do not choose a Day first, you will see a complete listing of CIS courses. You will notice that there are some classes that meet on MONDAY only (M) and some that meet Monday and Wednesday (M,F). But when you choose the day, Monday, in the drop-down menu, you will notice that classes that ONLY meet on MONDAY will appear.
Credit goes to Sun at Gossamer for providing the codes.
Thanks, Sun.
Hope this helps.
Regards,
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
1) Replace the following line in the sub query routine in db.cgi file:
Code:
($in{'ww'}) and ($tmpreg = "\\b$tmpreg\\b");with the following codes:
Code:
($in{'ww'}) and ($tmpreg = "^$tmpreg\$");2) In the sub-routine where you have your search form (like your sub view_search routine) in your html.pl file, you can either add a hidden field or checkbox for users to choose "Exact Word Match".
Here is how you add a hidden field:
Code:
<input type=hidden name="ww" value="on">Here is how you add a checkbox for this search option:
Code:
<input type=checkbox name="ww" value="on"> Exact Word MatchThis should solve the problems that some users are having in terms of matching exact data/values in fields.
I have tested this mod on three different DBMAN projects and it works very nice.
To see this mod in action, go to the following URL:
www.coco.cc.az.us/cgi-bin/schedules/index.cgi?&uid=default
To see how this works, choose the following search criteria:
Subject: Computer Information Systems (CIS)
Days: Monday
If you do not choose a Day first, you will see a complete listing of CIS courses. You will notice that there are some classes that meet on MONDAY only (M) and some that meet Monday and Wednesday (M,F). But when you choose the day, Monday, in the drop-down menu, you will notice that classes that ONLY meet on MONDAY will appear.
Credit goes to Sun at Gossamer for providing the codes.
Thanks, Sun.
Hope this helps.
Regards,
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us