Ver Mensaje Individual
  #7 (permalink)  
Antiguo 26/10/2011, 09:49
Avatar de CesarHC
CesarHC
 
Fecha de Ingreso: junio-2011
Ubicación: localhost
Mensajes: 566
Antigüedad: 12 años, 10 meses
Puntos: 56
Respuesta: Dompdf y myssql

Si efectivamente tenia mal los tags ,asi los tengo ahora probe y funciona en verdad es una libreria muy util gracias de nuevo por la ayuda.

Código PHP:
Ver original
  1. <?php
  2. require_once("../pdf/dompdf/dompdf_config.inc.php");
  3. $conexion = mysql_connect("localhost", "root", "");
  4. mysql_select_db("reqcot", $conexion);
  5. $query_R_2 = "SELECT * FROM prueba";
  6. $R_2 = mysql_query($query_R_2, $conexion) or die(mysql_error());
  7. $row_R_2 = mysql_fetch_assoc($R_2);
  8. $totalRows_R_2 = mysql_num_rows($R_2);
  9. $html =
  10. '<html><body>
  11. <table width="100%" border="0" cellspacing="0" cellpadding="0">';
  12. while ($row_R_2 = mysql_fetch_assoc($R_2))
  13. {
  14. $html .= '
  15. <tr>
  16. <td>Nro registro</td>
  17. <td>Nombre</td>
  18. <td bgcolor="#6600CC">Marca</td>
  19. </tr>
  20. <tr>
  21. <td>XXX</td>
  22. <td><div align="center">'.$row_R_2["nombre"].'</div></td>
  23. <td><div align="right">'.$row_R_2["apellido"].'</div></td>
  24. </tr>';
  25. };
  26. $html .= '
  27. </table>
  28. </body></html>';
  29. $dompdf = new DOMPDF();
  30. $dompdf->load_html($html);
  31. $dompdf->render();
  32. $dompdf->stream("sample.pdf", array('Attachment'=>'0'));
  33. ?>
__________________
Solo la práctica no te traicionara ¡¡¡¡¡¡

Seguir el camino tu debes PHP The Right Way.