Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/04/2016, 13:04
sonystar_17
 
Fecha de Ingreso: septiembre-2015
Mensajes: 142
Antigüedad: 8 años, 7 meses
Puntos: 13
Respuesta: select + array + for de ids

y porque no algo así :

Código PHP:
Ver original
  1. include("tu archivo conexion");
  2. $id=array(1,2,3,4);  
  3.  
  4. foreach ($id as $ids => $keyv)
  5.    
  6. {
  7.     $stmt = $conexion->prepare('SELECT * FROM tabla WHERE Id =:id');
  8.     $stmt -> bindValue(':id',$keyv);
  9.     $stmt->execute();
  10.     while($datos = $stmt->fetch())
  11.     {
  12.     $nombre[]= $datos["Nombre"];
  13.     }  
  14.    
  15. }
  16. print_r($nombre);