Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/03/2010, 11:04
vili86
 
Fecha de Ingreso: septiembre-2009
Mensajes: 281
Antigüedad: 15 años, 4 meses
Puntos: 0
Pregunta Asignar esta consulta a una variable ?

Amigos hago una busqueda multiple me salen los resultados en la pantalla o lo q quiero es pasar esa consulta con esos resultados a un pdf bueno lo ejecuto en la misma script todo asi.
Código PHP:

 <form action="modulos/consultas/vistas/busqueda_avanzada.html.php" method="post" target="_blank">  
<?php
       
       
include ('PHPPaging.lib.php');
       include(
'pdf/class.ezpdf.php'); 
        
$con mysql_connect("localhost","xxx","xxx") or die (mysql_error());
       
mysql_select_db("bd_xxxx",$con) or die (mysql_error());
    
// es aqui donde ejecuta la consulta para que me muestre los resultados en la pantalla.
     
$paging->agregarConsulta("SELECT * FROM jugadores Where (nombre='$nombre' or '$nombre'='') and (paterno='$paterno' or '$paterno'='') and  (materno='$materno' or '$materno'='') and (registro_fbf='$registro_fbf' or '$registro_fbf'='') and (ci='$ci' or '$ci'='') and  (edad='$edad' or '$edad'='') and (fecha_n='$fecha_n' or '$fecha_n'='') and (categoria='$categoria' or '$categoria'='') and (club='$club' or '$club'='') and (estado='$estado' or '$estado'='') and (lugar='$lugar_n' or '$lugar_n'='') and (nacionalidad='$nacionalidad' or '$nacionalidad'='') ",$server_link); 
             
            
$paging->porPagina(20); 
                       while(
$row $paging->fetchResultado()) {
                echo 
"<tr>";
                echo 
"<td>".$row['ci']."</td>";
                echo 
"<td align=left>".$row['nombre']."</td>";
                echo 
"<td align=left>".$row['paterno']."</td>";
                echo 
"<td align=left>".$row['materno']."</td>";
                echo 
"<td>".$row['fecha_n']."</td>";
                echo 
"<td>".$row['nacionalidad']."</td>";
                echo 
"<td align=left>".$row['club']."</td>";
                echo 
"<td>".$row['categoria']."</td>";

     
  
// bien en el mismo script realizo mi pdf 

     
$pdf = & new Cezpdf('letter','landscape');
              
$pdf->selectFont('pdf/fonts/Helvetica');
              
$pdf->ezSetCmMargins(1,1,1.5,1.5);// margenes
              
$pdf->ezStartPageNumbers(500,18,10,'','{PAGENUM} de {TOTALPAGENUM}',1);
              
              
$all $pdf->openObject();
              
$pdf->saveState();
              
$pdf->setStrokeColor(0,0,0,1);
              
$pdf->line(20,30,750,30);
              
$pdf->line(20,585,750,585);
 
$pdf->restoreState();
              
$pdf->closeObject();
               
// termina las lineas
              
$pdf->addObject($all,'all');
              
$queEmp -> agregarConsulta;
              
$resEmp mysql_query($queEmp$con) or die(mysql_error());
              
$totEmp mysql_num_rows($resEmp);
                  
// creo un while para generar la tabla con sus campos
            
                  
$ixx 0;
                  while(
$datatmp mysql_fetch_assoc($resEmp)) {
                       
$ixx $ixx+1;
                       
$data[] = array_merge($datatmp, array('num'=>$ixx));
                    
                  
$titles = array(
                                   
'num'=>'<b>Nº</b>',
                                   
'nombre'=>'<b>Nombres</b>',
                                   
'paterno'=>'<b>Ape. Paterno</b>',
                                   
'materno'=>'<b>Ape. Materno</b>',
                                   
'categoria'=>'<b>Categoria </b>',
                                   
'nacionalidad'=>'<b>Nacionalidad </b>',
                                   
'club'=>'<b>Club</b>',
                                   
'ci'=>'<b>CI</b>'
                                 
);
                 
                 
$options = array(
                                  
'shadeCol'=>array(0.9,0.9,0.9),
                                  
'xOrientation'=>'center',
                                  
'width'=>700
                                 
);
                 }
Es aqui mi problema.
COMO PUEDO ALMACENAR A ESTA VARIABLE $queEmp TODO EL VALOR DE ESTA CONSULTA $paging->agregarConsulta("SELECT * FROM jugadores Where (nombre='$nombre' or '$nombre'='') ETC ETC ,
INTENTE ESTO PERO:
Código PHP:
 $queEmp -> agregarConsulta
Me vota al ponei imprimir la misma pagina pero sin convertor a pdf ???????

Última edición por vili86; 23/03/2010 a las 11:07 Razón: Me olvide datos