<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[problema legame tra id]]></title><description><![CDATA[<p dir="auto">ciao a tutti ho un grande problema:</p>
<p dir="auto">io ho una tabella dalla quale riesco a prendere i miei 2 id che chiamo A B  (sono gli idlista).</p>
<p dir="auto">poi in un altra tabella che si chiama include ho la seguente situazione:</p>
<p dir="auto">all'id A corrispondo 3 id che chiamo a,b,c</p>
<p dir="auto">all'id B corrispondo 2 id che chiamo  d,f</p>
<p dir="auto">ora il problema è che non riesco a prendere e quindi stampare gli id a,b,c,d,f</p>
<p dir="auto">come posso fare.</p>
<p dir="auto">posto il codice sino a dove sono arrivato, cioè ho trovato gli idlista</p>
<pre><code>$query1 = "SELECT idlista FROM definisce where idutente = '$idutente'"; 
$result = mysql_query($query1) or die("Errore nella query1:".mysql_error());
$numerorighe = mysql_num_rows($result);


for($x=0; $x&lt;$numerorighe; $x++){

    $riga = mysql_fetch_array($result); 
    $idlista = $riga['idlista'];        


}
</code></pre>
]]></description><link>https://dev.connect.gt/topic/22069/problema-legame-tra-id</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Dec 2026 15:52:12 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/22069.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 25 Nov 2006 22:13:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to problema legame tra id on Sun, 26 Nov 2006 11:22:56 GMT]]></title><description><![CDATA[<p dir="auto">ciao Tymba e buona domenica.</p>
<p dir="auto">allora il problema è il seguente: $riga = array ('157','158'); ottengo tutti gli idutente che sn associati a quelle id che sn 157 e 158.ho fatto cosi x fare una prova e vedere se il codice del foreach funzionava e va ok.</p>
<p dir="auto">però li devo avere in $riga = mysql_fetch_array($result1); però non mi va cosi:</p>
<p dir="auto">come posso fare, l soluzione che hai scritto con il while non l'ho capita.</p>
<pre><code>&lt;?php
//Includo i file per la connessione
//e per la verifica Utente
require_once('connessione.php');
require_once('verificalogin.php');

?&gt;

&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;?php
if(IsSet($_SESSION['utenteM'])){
}else
{
    echo "errore";
}



$user=$_SESSION['utenteM'][0];



    $query1 = "SELECT * FROM utente WHERE username = '$user'"; 
     $result1 = mysql_query($query1) or die("Errore nella query1:".mysql_error());  
      $row = mysql_fetch_array($result1); 
     $idutente = $row['idutente'];
     
     //echo $idutente ;


      $query1 = "SELECT * FROM definisce WHERE idutente = '$idutente'"; 
     $result1 = mysql_query($query1) or die("Errore nella query1:".mysql_error()); 
     $numerorighe = mysql_num_rows($result1);
     
    //echo $numerorighe;
     
for($x=0; $x&lt;$numerorighe; $x++){
                                
     $riga = mysql_fetch_array($result1); 
    //$idliste = $riga['idlista'];
    //    echo $idliste;



//$riga = array ('157','158');
     

foreach ($riga as $value) {

    $query2 = "SELECT * FROM include WHERE idlista = '$value'"; 
     $result1 = mysql_query($query2) or die("Errore nella query2:".mysql_error()); 
    $numerorighe = mysql_num_rows($result1);
    
    echo "&lt;br&gt;$numerorighe";
    
    for($x=0; $x&lt;=$numerorighe; $x++){
                            
     $resrow = mysql_fetch_row($result1);
     $idutente=$resrow['1'];
     
     echo  "&lt;br&gt;$idutente";
    
    
     
     }
     
    
}}


?&gt;


&lt;/body&gt;
&lt;/html&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/post/401492</link><guid isPermaLink="true">https://dev.connect.gt/post/401492</guid><dc:creator><![CDATA[matti]]></dc:creator><pubDate>Sun, 26 Nov 2006 11:22:56 GMT</pubDate></item><item><title><![CDATA[Reply to problema legame tra id on Sun, 26 Nov 2006 01:16:06 GMT]]></title><description><![CDATA[<p dir="auto">ciao, puoi fare così:</p>
<p dir="auto">while($row=mysql_fetch_array($result1))<br />
array_push($liste,$row['nome del campo']);</p>
<p dir="auto"><img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/customizations/54a3bffb-5e4a-4eb8-81dc-99b2072e5d05-175.gif?v=3abbd2034aa" class="not-responsive emoji emoji-customizations emoji--ciauz" style="height:1.4em;width:auto;vertical-align:middle" title=":ciauz:" alt="" /></p>
]]></description><link>https://dev.connect.gt/post/401488</link><guid isPermaLink="true">https://dev.connect.gt/post/401488</guid><dc:creator><![CDATA[tymba]]></dc:creator><pubDate>Sun, 26 Nov 2006 01:16:06 GMT</pubDate></item><item><title><![CDATA[Reply to problema legame tra id on Sat, 25 Nov 2006 23:13:26 GMT]]></title><description><![CDATA[<p dir="auto">CIAO SPACCIOMAN, SN RIUSCITO A RISOVERE USANDO UN CICLO FOR E UN FOREACH.</p>
<p dir="auto">L'UNICA COSA CHE NON RIESCO A FARE è che se ho</p>
<p dir="auto">$row = mysql_fetch_array($result1);</p>
<p dir="auto">come faccio a scriverlo come vettore del tipo:</p>
<p dir="auto">$liste = array('152','153');</p>
]]></description><link>https://dev.connect.gt/post/401491</link><guid isPermaLink="true">https://dev.connect.gt/post/401491</guid><dc:creator><![CDATA[matti]]></dc:creator><pubDate>Sat, 25 Nov 2006 23:13:26 GMT</pubDate></item><item><title><![CDATA[Reply to problema legame tra id on Sat, 25 Nov 2006 22:46:41 GMT]]></title><description><![CDATA[<p dir="auto">non ho capito <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/customizations/f71a0c43-865f-4388-9868-8b387eebeeb1-mmmm.gif?v=3abbd2034aa" class="not-responsive emoji emoji-customizations emoji--mmm" style="height:1.4em;width:auto;vertical-align:middle" title=":?" alt="" /></p>
]]></description><link>https://dev.connect.gt/post/401490</link><guid isPermaLink="true">https://dev.connect.gt/post/401490</guid><dc:creator><![CDATA[spaccioman]]></dc:creator><pubDate>Sat, 25 Nov 2006 22:46:41 GMT</pubDate></item></channel></rss>