Firefox vs. IE

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!

Moderator: General Moderators

Post Reply
thallish
Forum Commoner
Posts: 60
Joined: Wed Mar 02, 2005 11:38 am
Location: Aalborg, Denmark

Firefox vs. IE

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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?
thallish
Forum Commoner
Posts: 60
Joined: Wed Mar 02, 2005 11:38 am
Location: Aalborg, Denmark

Post by thallish »

yep it was that double qoute that did the damage to IE. now it's working fine

thx

thallish :)
Post Reply