not sure if I fully understand your code, why do you use a while loop if you expect 0 or 1 record?
and why do you return an array if you just want one name?
anyway, mysql_fetch_array return an array that is indexed both numeric and with the field name, so all values are in there twice.
why not simply
if (!$result = mysql_query($sql)) {
return false;
} else {
if ($row = mysql_fetch_row($result)){
return $row[0];
}
// could need an else statement returning something in case no record matched
}