rendered paste bodywhile ($row = mysql_fetch_array($result)) { $pid = $row['pid']; echo "<form action=\"admin.php\" method=\"post\">\n"; echo "<tr><td>{$row['name']}</td><td>" . getPlayersTeamNameWithPID($pid) . "</td><td><select name=\"tid\">"; echo "<option value=\"-1\">None</option>"; $sqla = new SQL(); $sqla->connect('kok_ncsl3'); $resulta = $sqla->query("SELECT tid, tag FROM team ORDER BY tag"); echo mysql_error(); while ($rowa = mysql_fetch_assoc($resulta)) { echo "<option value=\"{$rowa['tid']}\">{$rowa['tag']}</option>\n"; }?> </select></td><td><input type="submit" value="Set" /></tr> <input type="hidden" name="action" value="setPlayersTeam" /> <input type="hidden" name="pid" value="<?php $pid ?>" /> </form><?php }