Lots of ways to crack this egg, in code or in sql. Also depends on what tools you have available. My first choice, since it is what I use everyday, would be Access/VBA and then load mysql with the results. In Access one would use the 'LIKE' operator to find out if an individual handset is in the handset list and append an entry in the matrix.
Assuming you are restricted to mysql/php then there are 2 mysql string functions that will do the job:
FIND_IN_SET(str,strlist)
Returns a value 1 to N if the string str is in the string list strlist consisting of N substrings. A string list is a string composed of substrings separated by ,' characters. If the first argument is a constant string and the second is a column of type SET, the FIND_IN_SET() function is optimized to use bit arithmetic. Returns 0 if str is not in strlist or if strlist is the empty string. Returns NULL if either argument is NULL. This function will not work properly if the first argument contains a comma (,') character.
mysql> SELECT FIND_IN_SET('b','a,b,c,d');
-> 2
or:
LOCATE(substr,str)
LOCATE(substr,str,pos)
The first syntax returns the position of the first occurrence of substring substr in string str. The second syntax returns the position of the first occurrence of substring substr in string str, starting at position pos. Returns 0 if substr is not in str.
mysql> SELECT LOCATE('bar', 'foobarbar');
-> 4
mysql> SELECT LOCATE('xbar', 'foobar');
-> 0
mysql> SELECT LOCATE('bar', 'foobarbar',5);
-> 7
This function is multi-byte safe. In MySQL 3.23, this function is case sensitive. For 4.0 on, it is case sensitive only if either argument is a binary string.
As you can see, a 0 means no match. So your insert into matrix query would be:
INSERT INTO matrix(game_id, set_id)
SELECT games.game_id, handsets.set_id
FROM games, handsets WHERE locate( handsets.name, games.handsets) >0
Each handset should now be matched with all games that have it listed. I have not checked the syntax so I'll be a bit chuffed if it runs first time, but I'm sure you get the idea. (I'm also guessing at the actual field names)
EDIT---------
On reflection, you should probably use the find_in_set on your comma delimited list as there may be things like a Nokia100 and a Nokia1000, which would produce false matches for the Nokia100 with my example.
INSERT INTO matrix(game_id, set_id)
SELECT games.game_id, handsets.set_id
FROM games, handsets WHERE find_in_set( handsets.name, games.handsets) >0