Creating a search form with multiple checkboxes
Posted: Fri Aug 18, 2006 12:56 pm
Hi there,
I'm still getting to grips with coding, using PHP and mySQL, and wonder if anyone can help with something I'm trying to do.
At the moment I have...
a table Candidates :
CandidateID (primary key, autonumber)
FirstName
LastName
etc
A table Profiles :
ProfileID (primary key, autonumber)
Profile (text)
And an interlinking table CandidateProfiles :
CandidateID (integer)
ProfileID (integer)
So if the CandidateProfiles table looks like :
1, 2
1, 4
1, 6
2, 2
2, 5
2, 6
3, 1
3, 6
4, 2
4, 3
4, 5
4, 6
I'd want to have a search form with a checkbox for each Profile, and if checkboxes 2, 5, and 6 were checked to return a results page listing Candidates 2 and 4, because they have matching Profiles 2, 5 and 6.
Hope that makes sense and maybe someone can point me in the right diection with it...
Cheers,
Iain
I'm still getting to grips with coding, using PHP and mySQL, and wonder if anyone can help with something I'm trying to do.
At the moment I have...
a table Candidates :
CandidateID (primary key, autonumber)
FirstName
LastName
etc
A table Profiles :
ProfileID (primary key, autonumber)
Profile (text)
And an interlinking table CandidateProfiles :
CandidateID (integer)
ProfileID (integer)
So if the CandidateProfiles table looks like :
1, 2
1, 4
1, 6
2, 2
2, 5
2, 6
3, 1
3, 6
4, 2
4, 3
4, 5
4, 6
I'd want to have a search form with a checkbox for each Profile, and if checkboxes 2, 5, and 6 were checked to return a results page listing Candidates 2 and 4, because they have matching Profiles 2, 5 and 6.
Hope that makes sense and maybe someone can point me in the right diection with it...
Cheers,
Iain