<? include 'include/bd.php'; $comando = "SELECT * FROM news WHERE status = 1 ORDER BY nome"; $exec = mysql_query($comando); while ($linha = mysql_fetch_assoc($exec)) { $string .= $linha[email].";"; } header('Content-type: text/plain'); header( 'Content-Length: ' . strlen( $string ) ); header('Content-Disposition: attachment; filename="save.txt"'); echo $string; ?>