$salida = es_un_array();mientras ($row = mysql_fetch_array($result) { $salida []= $row;} regresas $salida; // y no $row