Gossamer Forum
Home : Products : DBMan : Discussions :

Excluding records

Quote Reply
Excluding records
I'm still using DBMan SQL 1. Sorry, but it works too well.

Anway, I'd like to exclude specific records based on a field (the exclusion field) I've added to the database. The field will have the number "1" in it.

How would I change the search string to exclude those records that have a 1 in that field?

Thanks,

John
Quote Reply
Re: [jgold723] Excluding records In reply to
Exclusion is always tricky for me. Not too sure how to do it in SQL but I imagine the Perl part is the same...

Where would you be excluding it from? A search page?

If a search page you could add a hidden tag, but that probably wouldn't work too well. You could modify the search subroutine to contain something like (!($field_name eq "1")) or ($field_name ne "1").

(($name eq "bob") && ($exclude ne "1"))

It just depends on where you want to exclude from...
Quote Reply
Re: [Watts] Excluding records In reply to
I would be sending the exclusion command from the search page, so I could do a hidden field, if that would work.

John
Quote Reply
Re: [jgold723] Excluding records In reply to
If you do it that way, then'd it be better to have a flag for "include" as opposed to "exclude"

<INPUT TYPE="hidden" NAME="include" VALUE="Yes">

Or you could do 1 for exclude and then leave the value blank to find all of the recs that don't have a 1 (provided there is no other value in that field - meaning its either 1 or null)

<INPUT TYPE="hidden" NAME="exclude" VALUE="">