Re: [PHP-DB] Re: Dynamically populating a dropdown box

2001-12-14 Thread Paul DuBois
At 10:46 -0800 12/14/01, Richard S. Crawford wrote: >At the risk of sounding like a browser-snob... > >The quotes probably don't matter in IE, but that's primarily IE >allows (and, in my opinion, encourages) bad coding practices. > >Your "echo" command really ought to look like this: > >echo "" .

Re: [PHP-DB] Re: Dynamically populating a dropdown box

2001-12-14 Thread Richard S. Crawford
At the risk of sounding like a browser-snob... The quotes probably don't matter in IE, but that's primarily IE allows (and, in my opinion, encourages) bad coding practices. Your "echo" command really ought to look like this: echo "" . $row["name"] . "\n"; Many coders even forget to put in the

Re: [PHP-DB] Re: Dynamically populating a dropdown box

2001-12-14 Thread Ian Ferger
also, to get existing vals to show in the select as default, while($row=mysql_fetch_array($result)){ $selected=($row["ID"]==$ID)?"selected":""; echo "" . $row["name"] . "\n"; } the value can be in single quotes also, altho i dont think quotes matter unless you use opera or some other wierdass b

RE: [PHP-DB] Re: Dynamically populating a dropdown box

2001-12-14 Thread Andrew Chase
> I also prefer to use printf(" so it has the value in > quotes - just a fussy html thing i do though. If you like your code to be legible in a browser's 'View Source' function (which can sometimes be helpful for debugging), you can also add a newline "\n" character to the end of each option line

RE: [PHP-DB] Re: Dynamically populating a dropdown box

2001-12-14 Thread matt stewart
yep, that's basically what i use for this sort of thing - it's a nice short simple function, and works a treat. Obviously if you'd rather be passing the actual colour name to the next step, you use printf("%s", $myrow["colorname"], $myrow["colorname"]); I also prefer to use printf(" so it has the

Re: [PHP-DB] Re: Dynamically populating a dropdown box

2001-12-13 Thread ST Ooi
or alternatively, you can download a drop down box populating class from http://phpclasses.upperdesign.com/ - Original Message - From: "Matthew Crouch" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, December 14, 2001 6:57 AM Subject: [PHP-DB] Re: Dynamically populating a drop