"; echo ""; while($row=mysql_fetch_array($qry)) { echo ""; for($j=0; $j<$campos; $j++) { echo ""; } echo ""; } echo "
ID NOMBRE DESCRIPCION RUTA TIPO TAMAÑO CATEGORIA
".$row[$j]."
"; //$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 ""; while($row2=mysql_fetch_array($qry2)) { echo ""; for($j2=0; $j2<$campos; $j2++) { echo ""; } echo ""; } echo "
ID TITULAR RESUMEN NOTICIA IMAGEN FECHA
".$row2[$j2]."
"; $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; ?>