Well then, remove the alternate gender mod codes you've posted above, and replace with this:
PHP Code:
$code = rand(1,20000)
$tempgender = rand(0, 99);
if($tempgender < $row['genderratio']) {
$gender = "f";
$alts = "yes";
unset($tempgender);
}
else {
$gender = "m";
$alts = "no";
unset($tempgender);
}
runquery("INSERT INTO {$prefix}owned_adoptables VALUES ('', '{$row['type']}', '$name','$loggedinname','0','0', '$code', '','$alts','fortrade','no', '$gender','0')");