Gossamer Forum
Home : Products : DBMan : Customization :

Search a field using "or"

Quote Reply
Search a field using "or"
HI



I have an application where i need to search a "state" field and I need it to return contact from 5 states.

Presently I am using

http://120.12.15.3/cgi-bin/dbman/db.cgi/db.cgi?db=default&uid=&State=IL&view_records=1&ID=*"

To search for one particular state. The sample above I am looking for all recordds where state = IL. How can I modify this to search IL, CT, MA, ME, RI?

Thanks

Quote Reply
Re: [Erickroyer] Search a field using "or" In reply to
Taken from the FAQ noted below:

Recall multiple records by record ID (single search)

Question:

I'm trying to create a shopping cart like setup where users can place records in their basket. I would like for them to be able to view their basket contents. I'm looking for a way to recall multiple records by calling their record ID numbers in a single search.<P>
For example search the record ID field for records 2002 and 1234 and 3423 and 1532 and have only those records come back.

Response by Alex:

You could use regular expressions. Something like:

db.cgi?&amp;view_records=1&amp;ID=^2002|1234|3423|1532$&amp;re=1

Be sure to add the ^ and $ to then end so you get exact matches (i.e. 20 doesn't bring up 2000).

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

So perhaps using:

db.cgi?db=default&uid=default&view_records=1&State=^IL|CT|MA|ME|RI$&re=1

may provide what you need. Let me know if it worked.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Search a field using "or" In reply to
It does not work . I get an error when I run the page.

Here is what I have

(<a href="http://120.12.15.3/cgi-bin/dbman/db.cgi/
db.cgi?&amp;view_records=1&amp;State=^CT|TX$&amp;re=1">List All</a>)</font></b></td>



Any Ideas?
Quote Reply
Re: [Erickroyer] Search a field using "or" In reply to
Are you running this from a static page? Just wondering when you say the page is getting errors.

It seems you are missing the name of the db file in the code you gave above. I tried this url:

http://120.12.15.3/cgi-bin/dbman/db.cgi?db=default&uid=default&view_records=1&State=^CT|TX$&re=1

Do you actually have a directory called db.cgi under your dbman directory?

cgi-bin/dbman/db.cgi/


but after waiting quite awhile was unable to access your site.

Unoffical DBMan FAQ

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