Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/02/2011, 16:33
exeption_to_the_rule
 
Fecha de Ingreso: junio-2008
Mensajes: 16
Antigüedad: 16 años, 8 meses
Puntos: 0
Respuesta: exportar a excel

Hola! aqui tienes un ejemplo:

Previamente la conexión a base y demas...

Saludos y exitos!!!

Código:
header('Content-type: application/vnd.ms-excel');
header("Content-Disposition: attachment; filename=newsletter.xls");
header("Pragma: no-cache");
header("Expires: 0");
echo "<table border=1>\n";
echo "<tr>\n";
echo "<th>Nombre</th>\n";
echo "<th>Email</th>\n";
echo "</tr>\n";
do{
echo "<tr>\n";
echo "<td><font color=green>".$row_rsd_total['nomyapp']."</font></td>\n";
echo "<td>".$row_rsd_total['email']."</td>\n";
echo "</tr>\n";
} while ($row_rsd_total = mysql_fetch_assoc($rsd_total)); 
echo "</table>\n";