Ver Mensaje Individual
  #7 (permalink)  
Antiguo 29/01/2010, 15:43
devilboy9999
 
Fecha de Ingreso: octubre-2009
Mensajes: 125
Antigüedad: 15 años, 5 meses
Puntos: 2
Respuesta: [Duda] de php a excel

ke algun mod borre mis mensajes repetidos por favor ya lo solucioné, con las faqs del foro


Código:
<?php
include("C:\AppServ\www\ss\conexion\conexion.php");
$fecha = date("d-m-Y");
$query_reg = sprintf("SELECT * FROM usuarios limit 15");
$c_reg = mysql_query($query_reg) or die(mysql_error());
$totalRows_reg = mysql_num_rows($c_reg);

 //ruta del archivo a generar


$shtml= "<table border=1> ";
$shtml=$shtml. "<tr> ";
$shtml=$shtml. "<th>Nombre</th> ";

$shtml=$shtml. "</tr> ";
while($row_reg = mysql_fetch_assoc($c_reg)){
$shtml=$shtml. "<tr> ";
$shtml=$shtml. "<td>".$row_reg['user_nombre']."</td> ";

$shtml=$shtml. "</tr> ";


$sfile="Libro1.xls"; //ruta del archivo a generar
$fp=fopen($sfile,"w+");
fwrite($fp,$shtml);
fclose($fp);


}
echo "</table> ";


?>