Well something like this should do:
SELECT s.id, s.projectid, s2.name from skills s LEFT JOIN skills2 s2 ON s.projectid = s2.id WHERE s.active='Y';
In second query you had LIMIT 10 in the end. Why? It should only return one row as you use id in the where clause.
BTW, dont use count() function straight in for loop as it will count in every iteration. Its better to first assign the count to a variable and use the variable in the for loop. eg.
$cnt = count($data);
for($x =0; $x < $cnt; $x++)