"But what if no skills are selected and $skills is empty? is this going to work and select all the person_id's in that group?"
If a person selects no items, then there is no point in looking for people who match those items, is there? :-) You can just skip the query and forget about it.
"how do i compare them to see which person_id's are included in each set?"
Right now your query returns all people who have at least one match in the skills.
What you want to end up with is a list of people who have at least one match in all the selected items (not just for skills)
and you'll want to order them by the number of matches. (most matches first, then the people with fewer matches)
So in the end you just want a list of people and the total number of mathes per person.
So you can simply take the results from the first query, put them into an array like this:
$aPeople = array();
$aPeople['person_id']=$cnt;
so you get an array that contains the score, indexed by person_id. If a person has person_id=10 and cnt=4, then the 10th element will contain 4.
For the next query, you add the results to the same array. If person_id=10 gets a score of 7, then you add 7 to the previous score of 4, giving a total of 11.
If a person did not score in the first query but did score in the second, then just add the person to the array and enter his score for the second query.
After you ran all the queries, you will have a list of people and the total score per person.
You can calculate the total number of selected items from the POST data from the form, so you can determine which people have a 100% score.