title: PHP & MS SQL - Foreach Loop?
body: <p>I have a table in my ms sql database and am using PHP.</p>
  
  <p>What I am trying to do is:</p>
  
  <p>Foreach User in table, get his age and favorite color. And for each entry i want to edit it before it is displayed. For example Each User that is retrieved and displayed on the webpage will be hyperlinked. His/her age will be hyperlinked and the color will also be hyperlinked.</p>
  
  <p>Incase I wasn't clear above, let me explain in a short psuedo-code (sorry):</p>
  
  <pre><code>foreach(item i in table.items)
  {
     var $name = i.name;
     var $age = i.age;
     var $color = i.color;
  
     webpage.display("&lt;a href="http://domain.com/page.php?name=$name"&gt;$name&lt;/a&gt;");
     webpage.display("&lt;a href=""&gt;$age&lt;/a&gt;");
     webpage.display("&lt;a href=""&gt;$color&lt;/a&gt;");
  }
  </code></pre>
  
  <p>Can somebody please help me/put me in the right direction?</p>
  
  <p>Thank you</p>