PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a question with some data not being shown correctly in IE. I take some usernames out from a db and then throw them into a selection box. In IE it dosen't show the first name, that should appear in the selection box.
Now the funny thing is that, if I use a do-while loop on showing the results it works in both browsers. Well here is my code
// following code creates HTML selection box and fills it with the usernames from the database
// that is active
echo "<p>Vælg brugernavn: <br />";
echo "<select size=\"1\" name=\"userId\" \">";
// connecting to database
$connection = connection();
$query = "SELECT * FROM user WHERE isActivated='yes' ";
$result = mysql_query($query) or die("<p> Der opstod en fejl ved indhentning af data" . mysql_error() . "</p>");
while ($row = mysql_fetch_array($result)) {
echo "<option value=\"{$row['userId']}\">{$row['username']}</option>";
}
// closing database connection
DBClose();
echo "</select>";
echo "<input type=\"submit\" value=\"Vælg\" />";
echo "</p>";