Hello you all,
I could use some help. I have a small 'address'-book application where I offer the feature of assigning tags to contacts. The flexibility this tags give to the user is absolutely wonderfull..
The tags are being used for a search-command that includes contacts based on some basic search criteria and that have one or more tags assigned. Example:
Give me
- all contacts that have a name="bla",
- AND have assigned the following tags: "press" and "online".
I've got this working fine...
However, we now need to enhance the search-feature, where we can also exclude contacts that are assigned one or more tags. Example:
Give me
- all contacts that have a name="bla",
- AND have assigned the following tags: "press" and "online",
- AND do not have assigned the tags "to_be_deleted" and "no_more_mail"
The problem is that I don't see how to solve this new construct.
(A simplified version of) the solution I have sofar contains the following tables:
Table: contact
Fields: contactid (PK), firstname, lastname
Table: tag
Fields: tagid (PK), name
Table: contact_tag
Fields: contactid (PK), tagid (PK)
Anyone have any ideas on how to do this? Any help much appreciated!
Paul