Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/07/2012, 08:46
albertcito
 
Fecha de Ingreso: diciembre-2007
Mensajes: 169
Antigüedad: 17 años, 1 mes
Puntos: 6
Respuesta: Duda consulta Anidada con

Así me funciono, pero ya no esta anidad :( quería ver si se podía ser anidado y alguien que sepa mucho me explique!
Código PHP:
$query "
            SELECT 
               group_concat(p.ID) as ID
            FROM 
                $wpdb->term_relationships tr, 
                $wpdb->term_taxonomy tt, 
                $wpdb->terms t,  
                $wpdb->posts p
            WHERE 
                tr.object_id = p.ID AND
                tr.term_taxonomy_id = tt.term_taxonomy_id AND
                tt.term_id = t.term_id AND
                t.term_id = '$institucion' AND
                p.post_status = 'publish'
            "
;
    
$sql $wpdb->get_results($queryOBJECT);
    
$querystr "               
                SELECT 
                    t.term_id,
                    t.name
                FROM 
                    $wpdb->term_relationships tr, 
                    $wpdb->term_taxonomy tt,
                    $wpdb->terms t
                WHERE 
                    tr.object_id IN ("
.$sql[0]->ID.") 
                    AND
                    tr.term_taxonomy_id = tt.term_taxonomy_id AND
                    tt.term_id = t.term_id AND
                    tt.taxonomy = '$taxonomy'
                "

    
//echo  $querystr;
    
return $wpdb->get_results($querystrOBJECT); 
__________________
Inspiracion