Ver Mensaje Individual
  #6 (permalink)  
Antiguo 16/12/2010, 15:16
kenproxd
 
Fecha de Ingreso: agosto-2009
Mensajes: 349
Antigüedad: 14 años, 9 meses
Puntos: 8
Respuesta: Solo 1 resultado tras consulta

Cita:
Iniciado por Death_Empire Ver Mensaje
while($row1 = mysql_fetch_array($res1)) {

$first_post = $row1['topic_first_post_id'];

}

ese while solo te guarda la ultima id que haces en el select

prueba guardando en un arreglo

while($row1 = mysql_fetch_array($res1)) {

$first_post[] = $row1['topic_first_post_id'];

}

luego haces un implode
$ids = implode("','",$first_post);

y luego en la segunda consulta preguntas con un IN

sql = "SELECT * FROM phpbb_posts WHERE post_id IN ('". $ids ."') ORDER BY post_time DESC LIMIT 0,3";
Muchas gracias! funciona perfectamente