Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/06/2009, 16:08
zx9
 
Fecha de Ingreso: noviembre-2006
Mensajes: 29
Antigüedad: 18 años, 2 meses
Puntos: 2
Pregunta Ordenar array y agrupar comentarios

escenario:
JuanSuperFotos muestra varias fotos en un album y los usuarios dejan comentarios.
JuanSuperFotos quiere ver los comentarios en RENGLONES de cada foto SIN REPETIR la imagen de la foto.
La BD me dá este array y me partí la cabeza con tratar de ordenar y agrupar y no puedo solo. si alguien me ayuda , le estaré muy agradecido.

Código PHP:
Array
(
    [
0] => Array
        (
            [
0] => 9
            
[qa_id] => 9
            
[1] => 100555
            
[foto_id] => 100555
            
[2] => 9
            
[topicq_id] => 9
            
[3] => 100002
            
[senderq_id] => 100002
            
[4] => 100001
            
[receiverq_id] => 100001
            
[5] => 0
            
[isq_read] => 0
            
[6] => esa manzana esta madura y tiene buena sombra
            
[messageq_content] => esa manzana esta madura y tiene buena sombra
            
[7] => 
            [
messagea_content] => 
            [
8] => JuanSuperfotos
            
[receiverq_username] => JuanSuperfotos
            
[9] => 1243977010
            
[regq_date] => 1243977010
            
[10] => 0
            
[rega_date] => 0
            
[11] => MANZANITA EN LA PLAZA
            
[qtitulo] => MANZANITA EN LA PLAZA
        
)

    [
1] => Array
        (
            [
0] => 8
            
[qa_id] => 8
            
[1] => 100555
            
[foto_id] => 100555
            
[2] => 8
            
[topicq_id] => 8
            
[3] => 100002
            
[senderq_id] => 100002
            
[4] => 100001
            
[receiverq_id] => 100001
            
[5] => 0
            
[isq_read] => 0
            
[6] => el plato podria ser blanco en vez de verde
            
[messageq_content] => el plato podria ser blanco en vez de verde
            
[7] => 
            [
messagea_content] => 
            [
8] => JuanSuperfotos
            
[receiverq_username] => JuanSuperfotos
            
[9] => 1243974483
            
[regq_date] => 1243974483
            
[10] => 0
            
[rega_date] => 0
            
[11] => MANZANITA EN LA PLAZA
            
[qtitulo] => MANZANITA EN LA PLAZA
        
)

    [
2] => Array
        (
            [
0] => 7
            
[qa_id] => 7
            
[1] => 100777
            
[foto_id] => 100777
            
[2] => 7
            
[topicq_id] => 7
            
[3] => 100002
            
[senderq_id] => 100002
            
[4] => 100001
            
[receiverq_id] => 100001
            
[5] => 0
            
[isq_read] => 0
            
[6] => peras y unvasno estaría mejor ?
            [
messageq_content] => peras y uvasno estaría mejor ?
            [
7] => 
            [
messagea_content] => 
            [
8] => JuanSuperfotos
            
[receiverq_username] => JuanSuperfotos
            
[9] => 1243974310
            
[regq_date] => 1243974310
            
[10] => 0
            
[rega_date] => 0
            
[11] => PERAS EN CAJONES
            
[qtitulo] => PERAS EN CAJONES
        
)

    [
3] => Array
        (
            [
0] => 6
            
[qa_id] => 6
            
[1] => 100555
            
[foto_id] => 100555
            
[2] => 6
            
[topicq_id] => 6
            
[3] => 100002
            
[senderq_id] => 100002
            
[4] => 100001
            
[receiverq_id] => 100001
            
[5] => 0
            
[isq_read] => 0
            
[6] =>  y si le pones un filtro en rojo ?
            [
messageq_content] => y si le pones un filtro en rojo ?
            [
7] => 
            [
messagea_content] => 
            [
8] => JuanSuperfotos
            
[receiverq_username] => JuanSuperfotos
            
[9] => 1243974187
            
[regq_date] => 1243974187
            
[10] => 0
            
[rega_date] => 0
            
[11] => MANZANITA EN LA PLAZA
            
[qtitulo] => MANZANITA EN LA PLAZA
        
)

    [
4] => Array
        (
            [
0] => 5
            
[qa_id] => 5
            
[1] => 100555
            
[foto_id] => 100555
            
[2] => 5
            
[topicq_id] => 5
            
[3] => 100002
            
[senderq_id] => 100002
            
[4] => 100001
            
[receiverq_id] => 100001
            
[5] => 0
            
[isq_read] => 0
            
[6] => de donde sacaste esa manzana?
            [
messageq_content] => de donde sacaste esa manzana?
            [
7] => 
            [
messagea_content] => 
            [
8] => JuanSuperfotos
            
[receiverq_username] => JuanSuperfotos
            
[9] => 1243970969
            
[regq_date] => 1243970969
            
[10] => 0
            
[rega_date] => 0
            
[11] => MANZANITA EN LA PLAZA
            
[qtitulo] => MANZANITA EN LA PLAZA
        
)

    [
5] => Array
        (
            [
0] => 4
            
[qa_id] => 4
            
[1] => 100777
            
[foto_id] => 100777
            
[2] => 4
            
[topicq_id] => 4
            
[3] => 100002
            
[senderq_id] => 100002
            
[4] => 100001
            
[receiverq_id] => 100001
            
[5] => 0
            
[isq_read] => 0
            
[6] => subila sobre la escalera
            
[messageq_content] => subila sobre la escalera
            
[7] => 
            [
messagea_content] => 
            [
8] => JuanSuperfotos
            
[receiverq_username] => JuanSuperfotos
            
[9] => 1243970794
            
[regq_date] => 1243970794
            
[10] => 0
            
[rega_date] => 0
            
[11] => PERAS EN CAJONES
            
[qtitulo] => PERAS EN CAJONES
        
)

    [
6] => Array
        (
            [
0] => 3
            
[qa_id] => 3
            
[1] => 100555
            
[foto_id] => 100555
            
[2] => 3
            
[topicq_id] => 3
            
[3] => 100002
            
[senderq_id] => 100002
            
[4] => 100001
            
[receiverq_id] => 100001
            
[5] => 0
            
[isq_read] => 0
            
[6] => a mi parecer tiene mucho brillo
            
[messageq_content] => a mi parecer tiene mucho brillo
            
[7] => 
            [
messagea_content] => 
            [
8] => JuanSuperfotos
            
[receiverq_username] => JuanSuperfotos
            
[9] => 1243970690
            
[regq_date] => 1243970690
            
[10] => 0
            
[rega_date] => 0
            
[11] => MANZANITA EN LA PLAZA
            
[qtitulo] => MANZANITA EN LA PLAZA
        
)

    [
7] => Array
        (
            [
0] => 1
            
[qa_id] => 1
            
[1] => 100777
            
[foto_id] => 100777
            
[2] => 2
            
[topicq_id] => 2
            
[3] => 100002
            
[senderq_id] => 100002
            
[4] => 100001
            
[receiverq_id] => 100001
            
[5] => 0
            
[isq_read] => 0
            
[6] => y sile das mas foco que te parece?
            [
messageq_content] => y sile das mas foco que te parece?
            [
7] => 
            [
messagea_content] => 
            [
8] => JuanSuperfotos
            
[receiverq_username] => JuanSuperfotos
            
[9] => 1243970091
            
[regq_date] => 1243970091
            
[10] => 0
            
[rega_date] => 0
            
[11] => PERAS EN CAJONES
            
[qtitulo] => PERAS EN CAJONES
        
)

    [
8] => Array
        (
            [
0] => 2
            
[qa_id] => 2
            
[1] => 100555
            
[foto_id] => 100555
            
[2] => 1
            
[topicq_id] => 1
            
[3] => 100002
            
[senderq_id] => 100002
            
[4] => 100001
            
[receiverq_id] => 100001
            
[5] => 0
            
[isq_read] => 0
            
[6] => probaste con un gran angular de foco 1:2?
            [
messageq_content] => probaste con un gran angular de foco 1:2?
            [
7] => 
            [
messagea_content] => 
            [
8] => JuanSuperfotos
            
[receiverq_username] => JuanSuperfotos
            
[9] => 1243911176
            
[regq_date] => 1243911176
            
[10] => 0
            
[rega_date] => 0
            
[11] => MANZANITA EN LA PLAZA
            
[qtitulo] => MANZANITA EN LA PLAZA
        
)


mostrar 1 sola foto sin repetir y todos sus correspondientes comentarios en renglones
Ejemplo:

foto_id 100555 [qtitulo] "MANZANITA EN LA PLAZA"
[messageq_content] "esa manzana esta madura y tiene buena sombra"
[messageq_content] "el plato podria ser blanco en vez de verde"
[messageq_content] "y si le pones un filtro en rojo ?"
[messageq_content] "de donde sacaste esa manzana?"
[messageq_content] "a mi parecer tiene mucho brillo"
[messageq_content] "probaste con un gran angular de foco 1:2?"

foto_id 100777 [qtitulo] "PERAS EN CAJONES"
[messageq_content] "peras y uvas, no estaría mejor ?"
[messageq_content] "subila sobre la escalera"
[messageq_content] "y sile das mas foco , que te parece?"

.
Gracias