title: php while mysql_fetch_array inside while
body: <p>i have this part of a code and i cant understund why the second loop inside the first does not work. I query two tables and i placed an echo inside the second table to see if it echo's but it does not either . thanx in advance</p>
  
  <pre><code>while($row = mysql_fetch_array($result))
  {
   echo "&lt;li class=\"s01\"&gt;&lt;a class=\"s03\" href=" . $row['link'] . "&gt;&lt;span&gt;". $row['onomaselidas'] ."&lt;/span&gt;&lt;/a&gt;\n";
   echo "&lt;ul class=\"pn2\"&gt;\n";
   $idd[]=$row['idwebsiteprimary'];
     while($row2 = mysql_fetch_array($result2))
     {
      echo "test";
     if($idd[$url]==$row2['idwebsite'])
      {
      echo "&lt;li class=\"s01\"&gt;&lt;a href=\"a\"&gt;&lt;span&gt;". $row2['name'] ."&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;\n";
      }
     }
   echo "&lt;/ul&gt;\n";
  }
  </code></pre>