$data = //array dei valori
while ($row = mysql_fetch_assoc($result))
{
$nettofattura = htmlentities($row['nettofattura']);
$data[] = $nettofattura; //oppure sarebbe meglio usare array_push($data, $nettofattura)
}