";
echo "
| ID |
NOMBRE |
DESCRIPCION |
RUTA |
TIPO |
TAMAÑO |
CATEGORIA |
";
while($row=mysql_fetch_array($qry))
{
echo "";
for($j=0; $j<$campos; $j++) {
echo "| ".$row[$j]." | ";
}
echo "
";
}
echo "
";
//$reporte = ob_get_clean();
/********************************************
Write the query, call it, and find the number of fields
/********************************************/
$qry2 =mysql_query("SELECT * from noticias");
$campos2 = mysql_num_fields($qry2);
$i2=0;
/********************************************
Extract field names and write them to the $header
variable
/********************************************/
//ob_start();
echo " ";
echo "
| ID |
TITULAR |
RESUMEN |
NOTICIA |
IMAGEN |
FECHA |
";
while($row2=mysql_fetch_array($qry2))
{
echo "";
for($j2=0; $j2<$campos; $j2++) {
echo "| ".$row2[$j2]." | ";
}
echo "
";
}
echo "
";
$reporte = ob_get_clean();
/********************************************
Set the automatic downloadn section
/********************************************/
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=consulta.xls");
header("Pragma: no-cache");
header("Expires: 0");
echo $reporte;
?>