Ver Mensaje Individual
  #18 (permalink)  
Antiguo 29/03/2009, 18:11
majony
(Desactivado)
 
Fecha de Ingreso: diciembre-2008
Mensajes: 421
Antigüedad: 15 años, 4 meses
Puntos: 0
Respuesta: Como generar pdf despues de un buscar ??

Luego de complir una condena de 2 dias bien merecidos regreso al tema en cuestion hice esto:

Código php:
Ver original
  1. echo "<tr>";
  2.                 echo "<td>".$row['noticia_ID']."</td>";
  3.                 echo "<td>".$row['noticiaTitulo']."</td>";
  4.                 echo "<td>".$row['noticiaNoticia']."</td>";
  5.                 echo "<td>".$row['club']."</td>";
  6.                 ?>
  7.                 <input type="hidden" name="ids[<?=$row?>]" value="<?php echo $row
  8. ['noticia_ID']; ?>" />
  9.                 <?php
  10.                 ?>
  11.                 <td><a href="imprimir.php?id=<?php echo $row['noticia_ID']; ?>"><img src="imagenes/pdf.jpeg" align="middle"/></a> </td>
Este es el que me genera mi busqueda bien este es mi
generar_pdf.php

Código php:
Ver original
  1. <?php
  2.       include('pdf/class.ezpdf.php');
  3.       $ids =  $_POST['ids'];
  4.   $queEmp = "SELECT * FROM noticias WHERE noticia_ID='$ids'";
  5.        for ($i=1;$i< count($ids);$i++){
  6.             $queEmp = $queEmp . "noticia_ID=$ids[$i] OR ";
  7.         }
  8.         $queEmp = $queEmp . "noticia_ID=$ids[$i]";
  9.       //$queEmp = "SELECT *  FROM noticias Where club='$club'";
  10.       $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
  11.       $totEmp = mysql_num_rows($resEmp);
  12.       // creo un while para generar la tabla con sus campos
  13.  
  14.       $ixx = 0;
  15.       while($datatmp = mysql_fetch_assoc($resEmp)) {
  16.            $ixx = $ixx+1;
  17.            $data[] = array_merge($datatmp, array('num'=>$ixx));
  18.        
  19.       $titles = array(
  20.                        'num'=>'<b>Num</b>',
  21.                        'noticiaTitulo'=>'<b>Titulo</b>',
  22.                        'noticiaNoticia'=>'<b>Noticia</b>',
  23.                        'club'=>'<b>Club</b>'
  24.                      );
  25.      
  26.      $options = array(
  27.                       'shadeCol'=>array(0.9,0.9,0.9),
  28.                       'xOrientation'=>'center',
  29.                       'width'=>500
  30.                      );
  31.      }

El problema que tengo es en la consulta no se si sera la correcta lo que quiero hacer es poder agarra todos eso ids 1, 5 ,8 ,9 ,16 por decir y pasarlos a mi pdf pero tengo este error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'noticia_ID=' at line 1
este es mi problema