Ver Mensaje Individual
  #5 (permalink)  
Antiguo 27/08/2004, 08:58
jviera
 
Fecha de Ingreso: junio-2004
Mensajes: 29
Antigüedad: 19 años, 10 meses
Puntos: 0
Exclamación

Hola cluster, gracias por la verificacion, pero no me sale nada, me sale el este error en la pagina:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\pedidos\exportar6.php on line 15

aun así no se que hacer
Código PHP:
/*function Descargar($excel){
header("Content-Description: File Transfer");
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=".basename($excel));
@readfile($file);
}
*/
include("../pedidos/fcn/fcnConectarse.php");
$rpedidos=mysql_query("select * from pedidos");
$shtml="<table>";
$shtml=$shtml."<tr>";
$shtml=$shtml."<td>Periodo</td><td>Codigo_cta</td><td>cat11</td><td>id_item</td><td>tip_sum</td><td>cls_item</td><td>cant_item</td><td>ficha</td><td>actualiza</td><td>cerrado</td>";
$shtml=$shtml."</tr>";
while (
$reg mysql_fetch_array($rpedidos)) {
$excel $excel."<tr><td>".$reg["periodo"]."</td><td>".$reg["cod_cta"]."</td><td>".$reg["cat11"]."</td><td>".$reg["id_item"]."</td><td>".$reg["tip_sum"]."</td><td>".$reg[cls_item]."</td><td>".$reg[cant_item]."</td><td>".$reg["ficha"]."</td><td>".$reg["actualiza"]."</td><td>".$reg["cerrado"]."</td></tr>";
}
$shtml=$shtml."</table>";
$scarpeta="./exportar"//carpeta donde guardar el archivo.
//$clave=date("dmYHis");
//debe tener permisos 775 por lo menos
$excel=$scarpeta."/"."xxxx.xls"//ruta del archivo a generar
//$fp=fopen($sfile,"w");
/*fwrite($fp,$shtml);
fclose($fp);*/
echo"<a href='".$sfile."'>Haz click aqui</a><p></p>";
/*Descargar($sfile);
unlink($sfile)*/ 
espero que puedas ayudarme, gracias
saludos