ciao
ho la tabella pippo coi seguenti campi...
id_struttura id_sottostruttura
4 8
6 8
7 0
8 0
id_sottostruttura fa riferminto a id_struttura...
nel senso id_sottostruttura(4) e' una sottostruttura della struttura (8)
devo tirar fuori solo le struture con sottostruttura...(in questo caso solo la 8) perhce' 4 e 6 sono sottostrutture e 7 non ha sottostrutture
non sono sicuro di aver scelto la strada migliore e soprattuto qulla che rende la query piu veloce...il mio codice e' qui sotto...
$query="select * from pippo where id_sottostruttura !='0'";
$res=mysql_query($query)
where($row=mysql_fetch_array($res)){
select * from pippo wehre id_struttura='$row[0]'
}
altri suggeriemnti?
grazie ciaoo