|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
telepaisa Smarty n00b
Joined: 01 Jun 2010 Posts: 2
|
Posted: Wed Jun 02, 2010 12:00 am Post subject: iteracion dentro de otra |
|
|
saludos, tengo un problema, manejo una BD en MySQL tengo una tabla con usuarios otra de imagenes y una ultima de comentarios. Necesito mostrar todos los comentarios de todas las imagenes pero unicamente de un usuario en especifico. Hice un codigo pero no me da resultado, alguien podria ayudarme por favor?
Este es mi codigo actual:
$imagenes="SELECT * FROM 4images_images WHERE user_id=$mi_id ORDER BY image_id DESC";
$imagenes=mysql_query($imagenes) or die (mysql_error());
$i=0;
while($info=mysql_fetch_array($imagenes))
{
$id_imagen[$i]=$info['image_id'];
$comentarios="SELECT * FROM 4images_comments WHERE image_id=$id_imagen[$i]";
$comentarios=mysql_query($comentarios) or die (mysql_error());
$j=0;
while($info2=mysql_fetch_array($comentarios))
{
$id_comentario[$j]=$info2['comment_id'];
$texto[$j]=$info2['comment_text'];
$j++;
}
$i++;
} |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|