Gossamer Forum
Home : Products : DBMan : Customization :

Multiple Search

Quote Reply
Multiple Search
i used DBman to have our alumni list on the website and i was wondering if someone wanted to search from ID# 600 through 700 it would start showing 600 through 700 regardless if i add some new ones later that fill in between 600 through 700
http://members.xoom.com/TKE_Rho/index.html and then clikc on scroll and click on search alumni and da da da da
Quote Reply
Re: Multiple Search In reply to
Sure. DBMan will search for an sort on the field, no matter when it was entered, so long as you are entering the number and it's not being tracked by the script.

However, if you are going to search from 600 to 700, you'll need two text fields -- one for "greater than" and one for "less than." The user wouldn't need to fill in both of them unless he was doing a "between" search.


------------------
JPD

All my advice is offered on the basis of kindness-ware. If I've helped you to solve a problem, go out of your way to be kind to someone today.

Quote Reply
Re: Multiple Search In reply to
hmm thats sounds easy to do, but i cant say i am the smartest guy in the world, so can you put it in DUMB TERMS and how i could modify either the html.pl or db.cgi or default.cfg
Quote Reply
Re: Multiple Search In reply to
 Smile Sure!

You probably don't want the extra fields in your add form, so we'll do a little trick.

In html.pl -- sub html_record_form, at the beginning, you have something like:

Code:
print qq|<table border=1>
<TR><TD>Scroll:</TD>
<TD>P<input type="text" name="scroll" value="$rec{'scroll'}></TD></TR>|;

Right? (It's probably not exactly like that, but you should be able to figure out the part I'm talking about.)

replace the above with something like

Code:
print qq|<table border=1>
<TR><TD>Scroll:</TD>
<TD>|;

if ($in{'view_search}) {
print qq|From <input type="text" name="scroll-gt">
To <input type="text" name="scroll-lt">|;
}
else {
print qq|
P<input type="text" name="scroll" value="$rec{'scroll'}>|;
}
print qq|
</TD></TR>|;

You'll have to play around with the formatting to get it to look the way you want to, but that should work. (Famous last words! Smile )

If you want the same form to come up when there's no match (view failure), in html.pl sub view_failure, before

my ($message) = $_[0];

add

$in{'view_search'} = 1;

Now understand that if someone searches for records "From" 600 "To" 800, the search will return everything starting with 601 and ending with 799. That's just the way it works.


------------------
JPD

All my advice is offered on the basis of kindness-ware. If I've helped you to solve a problem, go out of your way to be kind to someone today.