07/06/2011, 10:08
|
| | Fecha de Ingreso: mayo-2011 Ubicación: Toluca
Mensajes: 115
Antigüedad: 13 años, 8 meses Puntos: 2 | |
Respuesta: -Problema para recorrer consulta?? Cita:
Iniciado por Nano_ Saludos
Podría ser de la siguiente manera:
Código PHP:
Ver original<?php require_once('html2pdf/html2pdf.class.php'); $html2pdf = new HTML2PDF ('1', 'Letter', 'es', false, 'ISO-8859-15', array(0, 0, 0, 0)); //conexion a la base $conexion = mysql_connect('localhost', 'root', '') or die("IMPOSIBLE CONECTARSE AL SERVIDOR"); $base = mysql_select_db('aceros_anglo', $conexion) or die("IMPOSIBLE CONECTARSE A LA BASE"); $c = "SELECT * FROM productos"; if ($filas > 0) { /* * ****CABECERA***** */// $html = "<table border='1' align='center'> <tr> <td bgcolor='DimGray'><font color= 'white'>Clave del producto</font></td> <td bgcolor='DimGray'><font color= 'white'>Nombre del producto</font></td> <td bgcolor='DimGray'><font color= 'white'>Existencias</font></td> </tr>"; $nombre = $row['nombre']; $idp = $row['idp']; $existencia = $row['existencia']; $html.="<tr> <td bgcolor='#CCCCCC'><b>" . $idp . "</b></td> <td bgcolor='#CCCCCC'><b>" . $nombre . "</b></td> <td bgcolor='#CCCCCC'><b>" . $existencia . "</b></td>"; $html.= "</tr>"; } $html.= "</table>"; } $html2pdf->WriteHTML($html); $html2pdf->Output('Nombre_de_tu_PDF.pdf', 'I'); ?>
Eres un geniecillo master, primer intento y listo ya quedo resuelto gracias... hay esta tu karma, y gracias al resto pero les gano jejeje |