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
Creating a search form with multiple checkboxes
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Looks like it'd be a SELECT on the Profiles table for the first listing. The search itself would be an INNER JOIN based SELECT linking the Profiles table to the Candidates table through your CandidatesProfiles table.
Cheers - I'm still a bit ropey on joins.
But with this, I think the main part I'm struggling with is how to record what checkboxes get checked in the checkbox, how to pass that to a results page, and compare those selected with the CandidateProfiles table.
But ultimately to have a search page like this.
But with this, I think the main part I'm struggling with is how to record what checkboxes get checked in the checkbox, how to pass that to a results page, and compare those selected with the CandidateProfiles table.
But ultimately to have a search page like this.