title: mysql_fetch_array is getting one value on my query
body: <p>I am trying to print a list of data from a mysql table, and then i want to print data from another table related to the first table. The first list is okay, but the second is only printing the last row of the data.</p>
  
  <pre><code>$queryfunc=mysql_query("select * from title");
  foreach ($func as $funcc){
  $iddd=$funcc[0];
  $funcao=$funcc[1];
  echo "&lt;li class='has-sub'&gt;&lt;a&gt;&lt;span&gt;" .$funcao. "&lt;/span&gt;&lt;/a&gt;";
  </code></pre>
  
  <p>At this point, i have a full list of the data from the first table. I need to take the ID of a row of the first list, and print the following with data related to that ID:</p>
  
  <pre><code>$newq=mysql_query("select nome from utilizadores where title=$iddd");
  $namm=array();
  while ($rowww=mysql_fetch_array($newq)) $namm[]=$rowww;
  foreach ($namm as $nomi){
  $nee=$nomi[0];
  echo "&lt;ul&gt;&lt;a href='php/curriculo.php?nomeut=$nomes' target=_blank&gt;" .$nee. "&lt;/a&gt;&lt;/ul&gt;";
      }
  }
  </code></pre>
  
  <p>Here, it is only printing the last result from the table. </p>
  
  <p>Thanks</p>