$row is not defined anywhere in the function. Perhaps you need to pass it as another paramter (or just the 'Sex' element)?
PS: I'd probably eschew the switch() and do something like:
<?php
function IsValidSkin($skinid, $sex)
{
if ($skinid > 299 || $skinid < 1) {
return false;
}
$ids = array(3,4,5,6,8,17,42,50,61,65,71,74,86,92,268,99,119);
if (in_array($skinid, $ids) && $sex == "1") {
echo ' case14';
return false;
}
return true;
}
Not sure what the actual logic is you want if the skinId is one of those values in the array, so that may not be exactly what you want.