Código PHP:
Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource in /home/rymchile/public_html/php/Personal/excel.php on line 5
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/rymchile/public_html/php/Personal/excel.php on line 11
Warning: Cannot modify header information - headers already sent by (output started at /home/rymchile/public_html/php/conexion.php:2) in /home/rymchile/public_html/php/Personal/excel.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home/rymchile/public_html/php/conexion.php:2) in /home/rymchile/public_html/php/Personal/excel.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home/rymchile/public_html/php/conexion.php:2) in /home/rymchile/public_html/php/Personal/excel.php on line 38
Warning: Cannot modify header information - headers already sent by (output started at /home/rymchile/public_html/php/conexion.php:2) in /home/rymchile/public_html/php/Personal/excel.php on line 39
no matching records found
codigo
Código PHP:
<?php
include("../conexion.php");
$sql="select * from ingreo_personal order by FECHA desc";
//$result = conexionl($sql);
$count = mysql_num_fields($result);
for ($i = 0; $i < $count; $i++){
$header .= mysql_field_name($result, $i)."\t";
}
while($row = mysql_fetch_row($result)){
$line = '';
foreach($row as $value){
if(!isset($value) || $value == ""){
$value = "\t";
}else{
$value = str_replace('"', '""', $value);
$value = '"' . $value . '"' . "\t";
}
$line .= $value;
}
$data .= trim($line)."\n";
}
$data = str_replace("\r", "", $data);
if ($data == "") {
$data = "\nno matching records found\n";
}
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=clientes.xls");
header("Pragma: no-cache");
header("Expires: 0");
echo $header."\n".$data;
?>
:arriba: