Ver Mensaje Individual
  #5 (permalink)  
Antiguo 01/04/2012, 12:52
johhan16
 
Fecha de Ingreso: junio-2010
Ubicación: Venezuela, Zulia
Mensajes: 686
Antigüedad: 13 años, 10 meses
Puntos: 55
Respuesta: Que estoy haciendo mal

osea de donde estas sacando anteriormente $num_rows, haz una prueba asi y me dices si te muestra 25

Código PHP:
Ver original
  1. <?php
  2. require_once('class.ezpdf.php');
  3. $pdf =& new Cezpdf('a4');
  4. $pdf->selectFont('../fonts/courier.afm');
  5. $pdf->ezSetCmMargins(1,1,1.5,1.5);
  6.  
  7. $conexion = mysql_connect("localhost", "root", "root");
  8. mysql_select_db("registros", $conexion);
  9. $queEmp = "SELECT * FROM individual where nivel=1";
  10. $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
  11. $totEmp = mysql_num_rows($resEmp);
  12.  
  13. $num_rows = 25; //esto es de prueba
  14.  
  15. $ixx = 0;
  16. while($datatmp = mysql_fetch_assoc($resEmp)) {  
  17.     $ixx = $ixx+1;
  18.     $data[] = array_merge($datatmp, array('num'=>$ixx));
  19. }
  20. $titles = array(
  21.                 'codigo'=>'<b>codigo</b>',
  22.                 'edad'=>'<b>edad</b>',
  23.                 'ciudad'=>'<b>ciudad</b>',
  24.                 'ocupacion'=>'<b>ocupacion</b>'
  25.             );
  26. $options = array(
  27.                 'shadeCol'=>array(0.9,0.9,0.9),
  28.                 'xOrientation'=>'center',
  29.                 'width'=>500
  30.             );
  31. $txttit = "<b>BLOG.UNIJIMPE.NET</b>\n";
  32. $txttit.= "Ejemplo de PDF con PHP y MYSQL \n";
  33. $pdf->ezImage("controldeinvent.jpg", "", "150", "none","left");
  34. $pdf->ezText($txttit, 12);
  35.  
  36. $pdf->ezTable($data, $titles, '', $options);
  37. $pdf->ezText("\n\n\n", 10);
  38. $pdf->ezText("<b>Registros:</b> ".$num_rows, 10);
  39. $pdf->ezText("<b>Fecha:</b> ".date("d/m/Y"), 10);
  40. $pdf->ezText("<b>Hora:</b> ".date("H:i:s")."\n\n", 10);
  41. $pdf->ezStream();
  42. ?>
__________________
<?php echo "No te metas a lo hondo del Mar si no sabes nadar, primero aprende a nadar" ?>
...Error en linea: 1 o.O