Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/02/2006, 10:54
Avatar de helthon
helthon
 
Fecha de Ingreso: junio-2005
Ubicación: Lima
Mensajes: 549
Antigüedad: 18 años, 10 meses
Puntos: 7
Exportar PHP a Excel, no me muesta mis campos solo </table>

Hola a todos estuve revisando los Faq's de este foro y vi la opcion de exportar un archivo excel por medio de php

tengo este escript, me abre el archivo pero solo me muestra </table>

Haber si me dan una manito y me ayudan a ver donde es el error.

Código PHP:
<?php
require_once('conectar.php');     
$sql "SELECT * FROM `opertation` "
$result mysql_query($sql$dbh) or die (mysql_error()); 
if (
mysql_num_rows($result))
{
$shtml="<table>";
$shtml=$shtml."<tr>";
$shtml=$shtml."<td colspan='7'><h3>Pacific International Air-Cargo</h3></td>";
$shtml=$shtml."</tr>";
$shtml=$shtml."<tr>";
$shtml=$shtml."<td colspan='7'><h4>Exportar files for status</h4></td>";
$shtml=$shtml."</tr>";
$shtml=$shtml."<tr>";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Customer</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Delivery Day </td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Nro Document</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Status</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Client</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Image</td> ";
$shtml=$shtml."<td bgcolor='#F0F0F0'>Date Process</td> ";
$shtml=$shtml."</tr>";
while(
$row mysql_fetch_array($result)) 

$shtml=$shtml."<td>".$row['idclie']."</td>";
$shtml=$shtml."<td>".$row['deliveryday']."</td>";
$shtml=$shtml."<td>".$row['nrodoc']."</td>";
$shtml=$shtml."<td>".$row['status']."</td>";
$shtml=$shtml."<td>".$row['respons']."</td>";
$shtml=$shtml."<td>".$row['view']."</td>";
$shtml=$shtml."<td>".$row['dateprocess']."</td>";
$shtml=$shtml."</tr>";
}
}
$shtml="</table>";
$scarpeta="a/"//carpeta donde guardar el archivo. 
$sfile=$scarpeta."statust.xls"//ruta del archivo a generar 
$fp=fopen($sfile,"w"); 
fwrite($fp,$shtml); 
fclose($fp); 
//echo "<a href='".$sfile."' target='_blank'><img src='../../imagenes/ico/excel.jpg' width='16' height='16'></a>"; 
echo "<a href='".$sfile."' target='_blank'>Haz click aqui</a>"
?>
thank
__________________
HELTHON FUENTES
FLORERIA FLORES PERU Floresperu.com.pe
Garantizamos que cada entrega de flores será de la más alta calidad y frescura