Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
iteracion dentro de otra

 
Post new topic   Reply to topic    Smarty Forum Index -> Language: Spanish
View previous topic :: View next topic  
Author Message
telepaisa
Smarty n00b


Joined: 01 Jun 2010
Posts: 2

PostPosted: Wed Jun 02, 2010 12:00 am    Post subject: iteracion dentro de otra Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Language: Spanish All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP