Foros del Web » Programando para Internet » PHP »

[SOLUCIONADO] Problemas al generar reportes creando PDF

Estas en el tema de Problemas al generar reportes creando PDF en el foro de PHP en Foros del Web. Hola soy nuevo en el foro y en la programación de PHP y quisiera saber si alguno me podría dar una mano para resolver un ...
  #1 (permalink)  
Antiguo 14/07/2015, 23:43
 
Fecha de Ingreso: julio-2015
Mensajes: 9
Antigüedad: 8 años, 9 meses
Puntos: 0
Problemas al generar reportes creando PDF

Hola soy nuevo en el foro y en la programación de PHP y quisiera saber si alguno me podría dar una mano para resolver un inconveniente que se me presento.

El tema es así, estoy generando un reporte de los datos almacenados en la Base de datos de mysql, y en cada registro tengo un botón para que genere un PDF con los datos de dicho registro, pero me trae todos los registros que tengo almacenados, se que algo me esta faltando y no se que es.

dejo los códigos para ver si alguno me puede orientar.

este es el Reporte

Código PHP:
Ver original
  1. <?php
  2.     include("conexion.php");
  3.    
  4.     $con = mysqli_connect($host,$user,$pw) or die("No se a podido conectar con el Host" . mysqli_error($link));
  5.    
  6.     mysqli_select_db($con,$db) or die("No se pudo conectar a la Base de Datos");
  7.    
  8.     $rst_ams = mysqli_query($con,"SELECT * FROM ams ORDER BY idForm desc");
  9.    
  10.     $num_registros = mysqli_num_rows($rst_ams);
  11.    
  12.         if ($num_registros==0)
  13.     {
  14.         echo "No Se Encontraron Registros En La Base De Datos";    
  15.    
  16.         mysqli_close($con);
  17.    
  18.         exit();
  19.     }
  20. ?>
  21.  
  22.  
  23. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  24. <html xmlns="http://www.w3.org/1999/xhtml">
  25. <head>
  26. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  27. <title>Listar Registros</title>
  28. <style type="text/css">
  29. body,td,th {
  30.     font-family: Arial, Helvetica, sans-serif;
  31. }
  32. </style>
  33. </head>
  34.  
  35. <body>
  36. <table width="75%" border="1" cellspacing="0" cellpadding="0">
  37.   <tr align="center">
  38.     <td width="11%" bgcolor="#0066FF">Formulario</td>
  39.     <td width="11%" bgcolor="#0066FF">Fecha</td>
  40.     <td width="14%" bgcolor="#0066FF">Nombre</td>
  41.     <td width="12%" bgcolor="#0066FF">Apellido</td>
  42.     <td width="10%" bgcolor="#0066FF">DNI</td>
  43.     <td width="17%" bgcolor="#0066FF">Empresa/Sector</td>
  44.     <td width="9%" bgcolor="#0066FF">Hora Ingreso</td>
  45.     <td width="16%" bgcolor="#0066FF">Hora Salida</td>
  46.     <td width="16%" bgcolor="#0066FF">&nbsp;</td>
  47.     <td width="16%" bgcolor="#0066FF">Reporte</td>
  48.   </tr>
  49.   <?php
  50.   while($fila = mysqli_fetch_array($rst_ams))
  51.   {
  52.   ?>
  53.   <tr>
  54.     <td><?php echo $fila["idForm"];?></td>
  55.     <td><?php echo $fila["Fecha"];?></td>
  56.     <td><?php echo $fila["Nombre"];?></td>
  57.     <td><?php echo $fila["Apellido"];?></td>
  58.     <td><?php echo $fila["DNI"];?></td>
  59.     <td><?php echo $fila["EmpSec"];?></td>
  60.     <td><?php echo $fila["HoraIn"];?></td>
  61.     <td><?php echo $fila["HoraSa"];?></td>
  62.     <td></td>
  63.     <td><form action="pdf_ams.php" method="post" name="reporte">
  64.               <input name="clave" type="hidden" value="<?php echo $fila["idForm"];?>" />
  65.               <input name="Fecha" type="hidden" value="<?php echo $fila["Fecha"];?>" />
  66.               <input name="Nombre" type="hidden" value="<?php echo $fila["Nombre"];?>" />
  67.               <input name="Apellido" type="hidden" value="<?php echo $fila["Apellido"];?>" />
  68.               <input name="DNI" type="hidden" value="<?php echo $fila["DNI"];?>" />
  69.               <input name="EmpSec" type="hidden" value="<?php echo $fila["EmpSec"];?>" />
  70.               <input name="Tarea" type="hidden" value="<?php echo $fila["Tarea"];?>" />
  71.               <input name="HoraIn" type="hidden" value="<?php echo $fila["HoraIn"];?>" />
  72.               <input name="HoraSa" type="hidden" value="<?php echo $fila["HoraSa"];?>" />
  73.                   <input type="submit" value="Generar" alt="cambio" title="Generar Reporte PDF"/>
  74.                 </form></td>
  75.   </tr>
  76.     <?php
  77.   }
  78.   ?>
  79. </table>
  80. </body>
  81. </html>

y este es el código para el PDF

Código PHP:
Ver original
  1. <?php
  2. require("../fpdf/fpdf.php");
  3. include("conexion.php");
  4.  
  5. $pdf = new FPDF();
  6. $pdf->AddPage();
  7. $pdf->SetFont('Arial','',8);
  8. $pdf->Image('../graphic/milogo.jpg',10,10,35,8,'JPG');
  9. $pdf->Cell(90,8,'',0);
  10. $pdf->Cell(10,8,'XXXX',0);
  11. $pdf->Cell(50,8,'',0);
  12. $pdf->Cell(10,8,'',0);
  13. $pdf->Cell(30,8,'',0);
  14. $pdf->Ln(8);
  15. $pdf->Cell(69,5,'XXXXXXXXXXXXXXXXXXXXXXXXXXXX',0);
  16. $pdf->Cell(52,5,'XXXXXXXXXXXXXXXXXXXXXXXXXXXX',0);
  17. $pdf->Cell(69,5,'',0);
  18. $pdf->Ln(5);
  19. $pdf->Cell(42,5,'',0);
  20. $pdf->Cell(106,5,'XXXXXXXXXXXXXXXXXXXXXXXXXXXX',0);
  21. $pdf->Cell(42,5,'',0);
  22. $pdf->Ln(10);
  23. //CONSULTA
  24. $con = mysqli_connect($host,$user,$pw) or die("No se a podido conectar con el Host" . mysqli_error($link));
  25.    
  26.     mysqli_select_db($con,$db) or die("No se pudo conectar a la Base de Datos");
  27.    
  28.     $rst_ams = mysqli_query($con,"SELECT * FROM ams");
  29.  
  30.     while($fila = mysqli_fetch_array($rst_ams))
  31.     {
  32. $pdf->SetFont('Arial','B',6);
  33. $pdf->Cell(16,4,'Fecha',0);
  34. $pdf->Cell(158,4,'',0);
  35. $pdf->Cell(16,4,'Formulario',0);
  36. $pdf->Ln(4);
  37. $pdf->SetFont('Arial','',5);
  38. $pdf->Cell(16,4,$fila['Fecha'],0);
  39. $pdf->Cell(158,4,'',0);
  40. $pdf->Cell(16,4,$fila['idForm'],0);
  41. $pdf->Ln(5);
  42. $pdf->SetFont('Arial','B',6);
  43. $pdf->Cell(30,4,'Nombre',0);
  44. $pdf->Cell(50,4,'',0);
  45. $pdf->Cell(30,4,'Apellido',0);
  46. $pdf->Cell(50,4,'',0);
  47. $pdf->Cell(30,4,'DNI',0);
  48. $pdf->Ln(4);
  49. $pdf->SetFont('Arial','',5);
  50. $pdf->Cell(30,4,$fila['Nombre'],0);
  51. $pdf->Cell(50,4,'',0);
  52. $pdf->Cell(30,4,$fila['Apellido'],0);
  53. $pdf->Cell(50,4,'',0);
  54. $pdf->Cell(30,4,$fila['DNI'],0);
  55. $pdf->Ln(5);
  56. $pdf->SetFont('Arial','B',6);
  57. $pdf->Cell(20,4,'Empresa / Sector:',0);
  58. $pdf->SetFont('Arial','',5);
  59. $pdf->Cell(170,4,$fila['EmpSec'],0);
  60. $pdf->Ln(5);
  61. $pdf->SetFont('Arial','B',6);
  62. $pdf->Cell(20,4,'Tarea:',0);
  63. $pdf->SetFont('Arial','',5);
  64. $pdf->Cell(170,4,$fila['Tarea'],0);
  65. $pdf->Ln(5);
  66. $pdf->SetFont('Arial','B',6);
  67. $pdf->Cell(15,4,'Hora Ingreso',0);
  68. $pdf->SetFont('Arial','',5);
  69. $pdf->Cell(15,4,$fila['HoraIn'],0);
  70. $pdf->SetFont('Arial','B',6);
  71. $pdf->Cell(15,4,'Hora Salida',0);
  72. $pdf->SetFont('Arial','',5);
  73. $pdf->Cell(15,4,$fila['HoraSa'],0);
  74. $pdf->Ln(7);
  75. $pdf->SetFont('Arial','B',6);
  76. $pdf->Cell(30,4,'Firma Solicitante',0);
  77. $pdf->Cell(50,4,'',0);
  78. $pdf->Cell(30,4,'Autorizante Entrada',0);
  79. $pdf->Cell(50,4,'',0);
  80. $pdf->Cell(30,4,'Firma Salida',0);
  81. $pdf->Ln(7);
  82. $pdf->SetFont('Arial','B',6);
  83. $pdf->Cell(30,4,'___________________',0);
  84. $pdf->Cell(50,4,'',0);
  85. $pdf->Cell(30,4,'___________________',0);
  86. $pdf->Cell(50,4,'',0);
  87. $pdf->Cell(30,4,'___________________',0);
  88. $pdf->Ln(7);
  89.     }
  90. $pdf->Output();
  91. ?>
  #2 (permalink)  
Antiguo 15/07/2015, 05:30
Avatar de xfxstudios  
Fecha de Ingreso: junio-2015
Ubicación: Valencia - Venezuela
Mensajes: 2.448
Antigüedad: 8 años, 10 meses
Puntos: 263
Respuesta: Problemas al generar reportes creando PDF

el problema esta en la consulta del pdf $rst_ams = mysqli_query($con,"SELECT * FROM ams");

cambiala asi

Código PHP:
Ver original
  1. $rst_ams = mysqli_query($con,"SELECT * FROM ams WHERE idForm = '$_post[idForm]'");

alli ya te va a mostrar solo el registro que pinches y no veo para que quieres un while en el pdf si vas a mostrar solo un registro, te recomiendo Dompdf es mas flexible y puedes armar la estructura en html sin tantas cell por todos lados
  #3 (permalink)  
Antiguo 15/07/2015, 11:16
 
Fecha de Ingreso: julio-2015
Mensajes: 9
Antigüedad: 8 años, 9 meses
Puntos: 0
Respuesta: Problemas al generar reportes creando PDF

Cita:
Iniciado por xfxstudios Ver Mensaje
el problema esta en la consulta del pdf $rst_ams = mysqli_query($con,"SELECT * FROM ams");

cambiala asi

Código PHP:
Ver original
  1. $rst_ams = mysqli_query($con,"SELECT * FROM ams WHERE idForm = '$_post[idForm]'");

alli ya te va a mostrar solo el registro que pinches y no veo para que quieres un while en el pdf si vas a mostrar solo un registro, te recomiendo Dompdf es mas flexible y puedes armar la estructura en html sin tantas cell por todos lados
Gracias!!! efectivamente ahora me saca un solo resultado, pero sin los datos de la Base de Datos, ósea solo me muestra lo que puse dentro del código, dejo el PDF que genera. [URL="http://www.angelprueba1.hol.es/pdf_ams1.pdf"]http://www.angelprueba1.hol.es/pdf_ams1.pdf[/URL]
  #4 (permalink)  
Antiguo 15/07/2015, 11:22
Avatar de xfxstudios  
Fecha de Ingreso: junio-2015
Ubicación: Valencia - Venezuela
Mensajes: 2.448
Antigüedad: 8 años, 10 meses
Puntos: 263
Respuesta: Problemas al generar reportes creando PDF

como te dije con domPdf esa tarea es tan sencilla que ni lo vas a creer
  #5 (permalink)  
Antiguo 15/07/2015, 21:24
 
Fecha de Ingreso: julio-2015
Mensajes: 9
Antigüedad: 8 años, 9 meses
Puntos: 0
Respuesta: Problemas al generar reportes creando PDF

antes que nada voy a pedir disculpas por que ya a estas alturas tengo una licuadora en ves de cabeza

lo que no me esta funcionando es traer los datos individualmente lo estoy haciendo en una pagina HTML y estoy en la misma instancia voy a dejar como están hasta el momento los códigos y por las dudas dos capturas de pantalla de la base de datos mysql calculo que dirán que soy medio lelo pero ya estoy mareado y no puedo resolver el problema.

una aclaración cuando pido el reporte de todos los datos almacenados en la db me los trae perfecto el tema es cuando quiero raer de a uno.

aquí dejo los códigos.

Registros.php

Código PHP:
Ver original
  1. <?php
  2.     include("conexion.php");
  3.    
  4.     $con = mysqli_connect($host,$user,$pw) or die("No se a podido conectar con el Host" . mysqli_error($link));
  5.    
  6.     mysqli_select_db($con,$db) or die("No se pudo conectar a la Base de Datos");
  7.    
  8.     $rst_ams = mysqli_query($con,"SELECT * FROM ams ORDER BY idForm desc");
  9.    
  10.     $num_registros = mysqli_num_rows($rst_ams);
  11.    
  12.         if ($num_registros=0)
  13.     {
  14.         echo "No Se Encontraron Registros En La Base De Datos";    
  15.    
  16.         mysqli_close($con);
  17.    
  18.         exit();
  19.     }
  20. ?>
  21.  
  22.  
  23. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  24. <html xmlns="http://www.w3.org/1999/xhtml">
  25. <head>
  26. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  27. <title>Listar Registros</title>
  28. <style type="text/css">
  29. body,td,th {
  30.     font-family: Arial, Helvetica, sans-serif;
  31. }
  32. </style>
  33. </head>
  34.  
  35. <body>
  36. <table width="75%" border="1" cellspacing="0" cellpadding="0">
  37.   <tr align="center">
  38.     <td width="11%" bgcolor="#0066FF">Formulario</td>
  39.     <td width="11%" bgcolor="#0066FF">Fecha</td>
  40.     <td width="14%" bgcolor="#0066FF">Nombre</td>
  41.     <td width="12%" bgcolor="#0066FF">Apellido</td>
  42.     <td width="10%" bgcolor="#0066FF">DNI</td>
  43.     <td width="17%" bgcolor="#0066FF">Empresa/Sector</td>
  44.     <td width="9%" bgcolor="#0066FF">Hora Ingreso</td>
  45.     <td width="16%" bgcolor="#0066FF">Hora Salida</td>
  46.     <td width="16%" bgcolor="#0066FF">&nbsp;</td>
  47.     <td width="16%" bgcolor="#0066FF">Reporte</td>
  48.   </tr>
  49.   <?php
  50.   while($fila = mysqli_fetch_array($rst_ams))
  51.   {
  52.   ?>
  53.   <tr>
  54.     <td><?php echo $fila["idForm"];?></td>
  55.     <td><?php echo $fila["Fecha"];?></td>
  56.     <td><?php echo $fila["Nombre"];?></td>
  57.     <td><?php echo $fila["Apellido"];?></td>
  58.     <td><?php echo $fila["DNI"];?></td>
  59.     <td><?php echo $fila["EmpSec"];?></td>
  60.     <td><?php echo $fila["HoraIn"];?></td>
  61.     <td><?php echo $fila["HoraSa"];?></td>
  62.     <td></td>
  63.     <td><form action="informe.php" method="post" name="reporte">
  64.               <input name="idForm" type="hidden" value="<?php echo $fila["idForm"];?>" />
  65.               <input name="Fecha" type="hidden" value="<?php echo $fila["Fecha"];?>" />
  66.               <input name="Nombre" type="hidden" value="<?php echo $fila["Nombre"];?>" />
  67.               <input name="Apellido" type="hidden" value="<?php echo $fila["Apellido"];?>" />
  68.               <input name="DNI" type="hidden" value="<?php echo $fila["DNI"];?>" />
  69.               <input name="EmpSec" type="hidden" value="<?php echo $fila["EmpSec"];?>" />
  70.               <input name="Tarea" type="hidden" value="<?php echo $fila["Tarea"];?>" />
  71.               <input name="HoraIn" type="hidden" value="<?php echo $fila["HoraIn"];?>" />
  72.               <input name="HoraSa" type="hidden" value="<?php echo $fila["HoraSa"];?>" />
  73.                   <input type="submit" value="Generar" alt="cambio" title="Generar Reporte PDF"/>
  74.                 </form></td>
  75.   </tr>
  76.     <?php
  77.   }
  78.   ?>
  79. </table>
  80. </body>
  81. </html>

este funciona en teoría bien me trae el reporte de todos los registros guardados como se ve en la imagen abajo.



por las dudas dejo la captura de la base de datos





y este es el muchachito que me hace doler la cabeza

informe.php

Código PHP:
Ver original
  1. <?php
  2.     include("conexion.php");
  3.    
  4.     $con = mysqli_connect($host,$user,$pw) or die("No se a podido conectar con el Host" . mysqli_error($link));
  5.    
  6.     mysqli_select_db($con,$db) or die("No se pudo conectar a la Base de Datos");
  7.    
  8.    
  9.     $rst_ams = mysqli_query($con,"SELECT * FROM ams WHERE idForm = '$_post[idForm]'");
  10.    
  11.    
  12.     $num_registros = mysqli_num_rows($rst_ams);
  13.    
  14.         if ($num_registros=0)
  15.     {
  16.         echo "No Se Encontraron Registros En La Base De Datos";    
  17.    
  18.         mysqli_close($con);
  19.    
  20.         exit();
  21.     }
  22. ?>
  23.  
  24. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  25. <html xmlns="http://www.w3.org/1999/xhtml">
  26. <head>
  27. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  28. <title>Documento sin título</title>
  29. <style type="text/css">
  30. body,td,th {
  31.     font-family: Arial, Helvetica, sans-serif;
  32. }
  33. </style>
  34. </head>
  35.  
  36. <body>
  37. <form action="procesar.php" method="post" name"form">
  38. <table width="1000" border="0" cellpadding="0" cellspacing="0">
  39.   <tr>
  40.     <td width="1219"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  41.       <tr>
  42.         <td width="377"><img src="../graphic/milogo.jpg" alt="" width="267" height="63" /></td>
  43.         <td width="414" align="center"><strong>XXXX</strong></td>
  44.         <td width="210" align="left"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  45. <?php
  46.   $fila = mysqli_fetch_array($rst_ams)
  47. ?>
  48.  
  49.           <tr>
  50.             <td width="61%">&nbsp;</td>
  51.             <td width="9%">N°</td>
  52.             <td width="30%"><?php echo $fila["idForm"];?></td>
  53.           </tr>
  54.         </table></td>
  55.       </tr>
  56.     </table></td>
  57.   </tr>
  58.   <tr>
  59.     <td align="center"><table width="1000" border="0" cellpadding="0" cellspacing="0">
  60.       <tr>
  61.         <td width="377"><strong>XXXXXXXXXXXXXXXXXXXXXXXXXXX</strong></td>
  62.         <td width="414" align="center"><strong>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</strong></td>
  63.         <td width="209">&nbsp;</td>
  64.       </tr>
  65.     </table></td>
  66.   </tr>
  67.   <tr>
  68.     <td>&nbsp;</td>
  69.   </tr>
  70.   <tr>
  71.     <td><strong>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</strong></td>
  72.   </tr>
  73.   <tr>
  74.     <td>&nbsp;</td>
  75.   </tr>
  76. </table>
  77. <p>&nbsp;</p>
  78. <table width="1010" border="0" cellspacing="0" cellpadding="0">
  79.   <tr>
  80.     <td width="140" height="18"><table width="1010" border="0" cellspacing="0" cellpadding="0">
  81.       <tr>
  82.         <td width="139">Fecha:</td>
  83.         <td width="135"><?php echo $fila["Fecha"];?></td>
  84.         <td width="483">&nbsp;</td>
  85.         <td width="253">&nbsp;</td>
  86.       </tr>
  87.     </table></td>
  88.   </tr>
  89.   <tr>
  90.     <td>&nbsp;</td>
  91.   </tr>
  92.   <tr>
  93.     <td>&nbsp;</td>
  94.   </tr>
  95.   <tr>
  96.     <td><table width="1010" border="0" cellspacing="0" cellpadding="0">
  97.       <tr>
  98.         <td width="139">Nombre:</td>
  99.         <td width="197"><?php echo $fila["Nombre"];?></td>
  100.         <td width="139">Apellido:</td>
  101.         <td width="209"><?php echo $fila["Apellido"];?></td>
  102.         <td width="139">D.N.I.</td>
  103.         <td width="187"><?php echo $fila["DNI"];?></td>
  104.       </tr>
  105.     </table></td>
  106.   </tr>
  107.   <tr>
  108.     <td>&nbsp;</td>
  109.   </tr>
  110.   <tr>
  111.     <td>&nbsp;</td>
  112.   </tr>
  113.   <tr>
  114.     <td height="18"><table width="1010" border="0" cellspacing="0" cellpadding="0">
  115.       <tr>
  116.         <td width="139">Empresa / Sector:</td>
  117.         <td width="871"><?php echo $fila["EmpSec"];?></td>
  118.         </tr>
  119.     </table></td>
  120.   </tr>
  121.   <tr>
  122.     <td>&nbsp;</td>
  123.   </tr>
  124.   <tr>
  125.     <td><table width="1010" border="0" cellspacing="0" cellpadding="0">
  126.       <tr>
  127.         <td width="139">Tarea:</td>
  128.         <td width="871"><?php echo $fila["Tarea"];?></td>
  129.       </tr>
  130.     </table></td>
  131.   </tr>
  132.   <tr>
  133.     <td>&nbsp;</td>
  134.   </tr>
  135.   <tr>
  136.     <td height="18"><table width="1010" border="0" cellspacing="0" cellpadding="0">
  137.       <tr>
  138.         <td width="139">Hora Entrada:</td>
  139.         <td width="271"><?php echo $fila["HoraIn"];?></td>
  140.         <td width="139">Hora Salida:</td>
  141.         <td width="461"><?php echo $fila["HoraSa"];?></td>
  142.         </tr>
  143.     </table></td>
  144.   </tr>
  145. </table>
  146.  
  147. </body>
  148. </html>

desde ya pido disculpas por las molestias
  #6 (permalink)  
Antiguo 15/07/2015, 21:35
Avatar de xfxstudios  
Fecha de Ingreso: junio-2015
Ubicación: Valencia - Venezuela
Mensajes: 2.448
Antigüedad: 8 años, 10 meses
Puntos: 263
Respuesta: Problemas al generar reportes creando PDF

Estas cerrando la conexion a la base antes de mostrar los resultados
  #7 (permalink)  
Antiguo 16/07/2015, 03:24
 
Fecha de Ingreso: julio-2015
Mensajes: 9
Antigüedad: 8 años, 9 meses
Puntos: 0
Respuesta: Problemas al generar reportes creando PDF

Listo mil gracias ya logre que funcionen las consultas, haciéndolo de esta manera.


Código PHP:
Ver original
  1. $con = mysqli_connect($host,$user,$pw) or die("No se a podido conectar con el Host" . mysqli_error($link));
  2.    
  3.     mysqli_select_db($con,$db) or die("No se pudo conectar a la Base de Datos");
  4.    
  5.     $num= $_POST['idForm'];
  6.    
  7.     $rst_ams = mysqli_query($con,"SELECT * FROM ams WHERE idForm = '$num'");
  8.    
  9.    
  10.     $num_registros = mysqli_num_rows($rst_ams);

Saludos y nuevamente gracias por la paciencia.

Etiquetas: creando, fecha, formulario, html, mysql, pdf, registro, reportes, select
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:34.