Page 1 of 1

Firefox vs. IE

Posted: Thu Mar 31, 2005 2:25 pm
by thallish
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

Code: Select all

// 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>";
does anybody know why it's behaving like this?

thallish

Posted: Thu Mar 31, 2005 2:32 pm
by feyd
you have an unterminated double quote in line 4. Maybe that's the problem?

Can you post some of what IE gets in source, versus Firefox?

Posted: Thu Mar 31, 2005 2:45 pm
by thallish
yep it was that double qoute that did the damage to IE. now it's working fine

thx

thallish :)