Hi all,
I have a serious problem and i dont no how to solve this. I have tryied my best and still cann`t figure it out 😕
I have 4 tables called,
1.mos_member_countries
- id double (prime)
- name varchar(255)
2.mos_member_counties
- id double (prime)
- name varchar(255)
- countryid double
mos_member_counties table is link to mos_member_countries table using the countryid .
3.mos_members
- memberid double (prime)
- company varchar(255)
- countyid double
mos_members is link to mos_member_counties table using the countyid.
(*) there is a table called mos_keys and it has memberid and keyid, and it`s not need here so i didnt post the db structure of that table. mos_members has many mos_keys so they have many to many relationship so i have below table to link them up.
4.mos_member_and_keys
- id double (prime)
- keyid double
- memberid double
so thats about it for my table structures.
in my search query i have checkboxes for mos_keys so user can include more than 1 key in there search. Also he can include country, county and companyname in there search.
So my problem arrise when i try to include more than 1 key in my search.
Ex: member1 has key 1 and 2 and member2 has key 1 and 3,
now i want all the members which has key 1 and 2.
I tried many queries but i get both of them as my result because both of them has key 1. But i just want only the member which has key 1 and 2.
does anyone no how to solve this problem.
All the posts are welcome,
Thanx in advance,
Regards,
Niroshan