Gossamer Forum
Home : Products : DBMan : Installation :

Searching multiple criteria returns no records

Quote Reply
Searching multiple criteria returns no records
Hi. I have DBMan working pretty well at
http://sun.he.net/...s/db.cgi?uid=default
but if a user selects more than one criteria in a field, no records are returned, even if Match any is selected. Any idea why?

thanks,
kim
Quote Reply
Re: Searching multiple criteria returns no records In reply to
"match any" refers to "match any field" not "match any within a field."

I see you have a number of checkboxes. It is highly preferable to have a field for each checkbox instead of having multiple checkboxes for each field. Then your searches will work correctly.



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





Quote Reply
Re: Searching multiple criteria returns no records In reply to
Well dang. So how do I use the build_checkbox_field function in my search form? Do I add several lines like this:
Code:
print &build_checkbox_field("Location1","$rec{'Location1'}");
print &build_checkbox_field("Location2","$rec{'Location2'}");
where LocationN corresponds to new fields in default.cfg?

Thanks,
Kim
Quote Reply
Re: Searching multiple criteria returns no records In reply to
Yep. That's the way to do it.

If you don't want to go through all the hassle of typing all of that, you might try using the "Configurator" at http://www.jpdeni.com/...figurator/config.cgi . That will create your checkboxes in the .cfg file and in the html.pl file for you. Just copy and paste from your browser into your files.


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





Quote Reply
Re: Searching multiple criteria returns no records In reply to
Dear JPDeni,

I don't understand this:

"match any" refers to "match any field" not "match any within a field."

so what means match any field ?

I suppose that is what the 'keyword' field does ?

I don't see the difference in searches (on my little test db) between 'ma' "on" or "off"

Thanks Paul



Quote Reply
Re: Searching multiple criteria returns no records In reply to
In Reply To:
I suppose that is what the 'keyword' field does ?
That is correct.

Regards,

Eliot Lee
Quote Reply
Re: Searching multiple criteria returns no records In reply to
Let's say you have the following fields in your database:

ID
Name
City

Your records are as follows:
1|Louis Armstrong|New Orleans
2|Joe Louis|Timbuktu
3|Wilma Flintstone|Timbuktu
4|Joe Smith|St. Louis

On the search form, in the "Name" field, you enter Louis. In the "City" field, you enter Timbuktu. You do not select "Match Any."

You will get

2|Joe Louis|Timbuktu

If you select "Match Any" with the same search criteria, you'll get

1|Louis Armstrong|New Orleans
2|Joe Louis|Timbuktu
3|Wilma Flintstone|Timbuktu

If you enter Louis in the keyword field, you'll get

1|Louis Armstrong|New Orleans
2|Joe Louis|Timbuktu
4|Joe Smith|St. Louis

Does this help?

JPD