Ver Mensaje Individual
  #7 (permalink)  
Antiguo 24/01/2013, 09:31
facundojr07
 
Fecha de Ingreso: enero-2013
Mensajes: 64
Antigüedad: 11 años, 3 meses
Puntos: 0
Respuesta: Exportar a Excel tabla mysql

Creo que no nos estamos entendiendo. Porque el codigo que me enviaste vos es para que lo exporte a excel directamente, el mismo no lo probé.
Y lo que yo estoy necesitando, que no se como hacerlo es que el siguiente codigo, que es la página

Código PHP:
<?php
error_reporting
(E_ERROR);
require(
"conexion.php");
require(
"funciones.php");


//.sqlValue($criterio1."%", "text")

    
$query "SELECT * FROM bd_rtdmf WHERE ID_N IN ('000')";
    
$queEmp mysql_query($query$conexion);
    

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Red Banda Ancha Fija</title>

<link href="styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="Silverlight Binaries/Visifire.js"></script>

</head>
<body>
<table width="100%" border="0">
  <tr>
    <td>
          <div align="center"><?php
    
include('menu-rtdmf4.php');
?>
      </div>
    </td>
  </tr>
  <tr>
    <td><p><span class="TITULO">000</span></p>
      <table width="100%" border="1" cellpadding="0" cellspacing="0">
      <tr>
        <th><div align="center">Mes</div></th>
        <th><div align="center">Trafico</div></th>
        <th><div align="center">Intentos</div></th>
        <th><div align="center">Tomas</div></th>
        <th><div align="center">Contestadas</div></th>
        <th><div align="center">Desborde</div></th>
        <th><div align="center">% TTR </div></th>
        <th><div align="center">% Desborde </div></th>
      </tr>
      <?php while ($rsEmp mysql_fetch_assoc($queEmp)) { ?>
      <tr>
        <td><div align="center"><?php echo $rsEmp['Nombre_mes']; ?></div></td>
        <td><div align="center"><?php echo $rsEmp['Trafico']; ?></div></td>
        <td><div align="center"><?php echo $rsEmp['Intentos']; ?></div></td>
        <td><div align="center"><?php echo $rsEmp['Tomas']; ?></div></td>
        <td><div align="center"><?php echo $rsEmp['Contestadas']; ?></div></td>
        <td><div align="center"><?php echo $rsEmp['Desborde']; ?></div></td>
        <td><div align="center"><?php echo $rsEmp['TTR']; ?></div></td>
        <td><div align="center"><?php echo $rsEmp['Desborde1']; ?></div></td>
      </tr>
      <?php ?>
    </table></td>
  </tr>
</table>
</body>
</html>
Agregarle un link para que esos datos me importen a excel. En las respuestas anteriores figura el codigo que le agregue, pero lo que hace es que al abrir la pagina directamente me descarga el xls. Igual muchas gracias. Creo que ya encontre la solución, voy a intentarlo y te aviso.

Última edición por facundojr07; 24/01/2013 a las 09:37