Foros del Web » Programando para Internet » PHP »

Que estoy haciendo mal

Estas en el tema de Que estoy haciendo mal en el foro de PHP en Foros del Web. no me imprime ninguna cantidad en esta parte $pdf->ezText("<b>Registros:</b> ".$num_rows, 10); que estoy haciendo mal Cdigo PHP: <?php require_once( 'class.ezpdf.php' ); $pdf  =& new  Cezpdf ( ...
  #1 (permalink)  
Antiguo 31/03/2012, 22:39
 
Fecha de Ingreso: noviembre-2011
Ubicacin: Paris
Mensajes: 450
Antigedad: 12 aos, 5 meses
Puntos: 7
Que estoy haciendo mal

no me imprime ninguna cantidad en esta parte $pdf->ezText("<b>Registros:</b> ".$num_rows, 10); que estoy haciendo mal


Cdigo PHP:
<?php
require_once('class.ezpdf.php');
$pdf =& new Cezpdf('a4');
$pdf->selectFont('../fonts/courier.afm');
$pdf->ezSetCmMargins(1,1,1.5,1.5);

$conexion mysql_connect("localhost""root""root");
mysql_select_db("registros"$conexion);
$queEmp "SELECT * FROM individual where nivel=1";
$resEmp mysql_query($queEmp$conexion) or die(mysql_error());
$totEmp mysql_num_rows($resEmp);

$ixx 0;
while(
$datatmp mysql_fetch_assoc($resEmp)) { 
    
$ixx $ixx+1;
    
$data[] = array_merge($datatmp, array('num'=>$ixx));
}
$titles = array(
                
'codigo'=>'<b>codigo</b>',
                
'edad'=>'<b>edad</b>',
                
'ciudad'=>'<b>ciudad</b>',
                
'ocupacion'=>'<b>ocupacion</b>'
            
);
$options = array(
                
'shadeCol'=>array(0.9,0.9,0.9),
                
'xOrientation'=>'center',
                
'width'=>500
            
);
$txttit "<b>BLOG.UNIJIMPE.NET</b>\n";
$txttit.= "Ejemplo de PDF con PHP y MYSQL \n";
$pdf->ezImage("controldeinvent.jpg""""150""none","left");
$pdf->ezText($txttit12);

$pdf->ezTable($data$titles''$options);
$pdf->ezText("\n\n\n"10);
$pdf->ezText("<b>Registros:</b> ".$num_rows10);
$pdf->ezText("<b>Fecha:</b> ".date("d/m/Y"), 10);
$pdf->ezText("<b>Hora:</b> ".date("H:i:s")."\n\n"10);
$pdf->ezStream();
?>
  #2 (permalink)  
Antiguo 01/04/2012, 09:04
 
Fecha de Ingreso: junio-2010
Ubicacin: Venezuela, Zulia
Mensajes: 686
Antigedad: 13 aos, 9 meses
Puntos: 55
Respuesta: Que estoy haciendo mal

es algo lgico yo no veo por ningn lado definido $num_rows
__________________
<?php echo "No te metas a lo hondo del Mar si no sabes nadar, primero aprende a nadar" ?>
...Error en linea: 1 o.O
  #3 (permalink)  
Antiguo 01/04/2012, 11:15
 
Fecha de Ingreso: noviembre-2011
Ubicacin: Paris
Mensajes: 450
Antigedad: 12 aos, 5 meses
Puntos: 7
Respuesta: Que estoy haciendo mal

como que no esta definido?
  #4 (permalink)  
Antiguo 01/04/2012, 12:31
 
Fecha de Ingreso: noviembre-2011
Ubicacin: Paris
Mensajes: 450
Antigedad: 12 aos, 5 meses
Puntos: 7
Respuesta: Que estoy haciendo mal

.............................
  #5 (permalink)  
Antiguo 01/04/2012, 12:52
 
Fecha de Ingreso: junio-2010
Ubicacin: Venezuela, Zulia
Mensajes: 686
Antigedad: 13 aos, 9 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

Cdigo 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
  #6 (permalink)  
Antiguo 02/04/2012, 00:14
 
Fecha de Ingreso: noviembre-2011
Ubicacin: Paris
Mensajes: 450
Antigedad: 12 aos, 5 meses
Puntos: 7
Respuesta: Que estoy haciendo mal

Hola gracias por tu apoyo pero me sigue marcando este error
Cdigo:
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\Practicas\pdf-php-mysql\php-mysql.php:1) in C:\AppServ\www\Practicas\pdf-php-mysql\class.pdf.php on line 1916

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\Practicas\pdf-php-mysql\php-mysql.php:1) in C:\AppServ\www\Practicas\pdf-php-mysql\class.pdf.php on line 1917

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\Practicas\pdf-php-mysql\php-mysql.php:1) in C:\AppServ\www\Practicas\pdf-php-mysql\class.pdf.php on line 1919
%PDF-1.3 % 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R >> /XObject << /I1 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text /ImageC ] endobj 5 0 obj << /Creator (R and OS php pdf writer, http://www.ros.co.nz) /CreationDate (D:20120401) >> endobj 6 0 obj << /Type /Page /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 246 >> stream xmMO0>ŵi{ֲmt#8|Lƅ*bKX~M>vD3*  %i0*͑8f`Ap1\ݲnm*\BBlnw6=/X߮ P=9y]ᑝsPHF }𹏇!Gp?*{~P5)TEљStmbJ% g(C+|m endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /XObject /Subtype /Image /Width 200 /Height 200 /ColorSpace /DeviceRGB /Filter /DCTDecode /BitsPerComponent 8 /Length 6396 >> stream JFIFddDucky(Adobedۄ   $$''$$53335;;;;;;;;;;   %% ## ((%%((22022;;;;;;;;;;"Ğ!1AQaq"2BR#3brSCcs$D!1AQaq"2BRb?T!BB !BB !BB !BB ! Ɲ(`PsWAw6M{JQsZ*too$??irM$*wRanz&L#ՓgثG?a&l3$ &,x.Ф[ńp@:ɒH7sGcVGrHB!!@B`, cjI&'\F @8)]Oi*[?De*Ogcp ڰ+I5ԇ-:5s[}٫ჴ~a^+=s#-Zk-oIug(hFOJzUKrK':Q<U+ l|oT<]H[ͼJ㰶znvG'2 WhW*/9-[Ek@3N*\f7bC cNv+: Fo˯2EJ\tCg!*Ю|<՞ S0Iui\|P8F'M,X*$>p[LV2E 5G"3N0dTqw 7jq5$BPöF.!}XVMGr uBB !E{̮o3] Wog|Llqk4dcw.(m`5y^DhEn95Sz3#n2mG^᯸aqĺ6דK4Q1NME]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10 0000000000 65535 f 0000000015 00000 n 0000000080 00000 n 0000000126 00000 n 0000000306 00000 n 0000000343 00000 n 0000000448 00000 n 0000000511 00000 n 0000000830 00000 n 0000000937 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R >> startxref 7502 %%EOF <kŌ-q1y.*hn

Etiquetas: haciendo, mysql, registro, sql
Atencin: Ests leyendo un tema que no tiene actividad desde hace ms 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 13:09.