Re: Select list with PHP

From: Date: Sun, 04 Feb 2001 16:23:39 +0000
Subject: Re: Select list with PHP
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-38101@lists.php.net to get a copy of this message
This worked! But, I get this color selection increment on each subsequent menu where the colors from the row above mix with the ones below and so on. Assume that the numbers are the actual colors: Select a color: ---------------------------- first menu1 next menu-> 1 next menu-> even longer 2 2 3 3 4 4 5 5 1 2 3 4 5 mysql_connect(); while ($row = mysql_fetch_array($sql_result)) { echo"<tr><td>"; echo $row["paint"]; echo"</td><td>"; echo $row["bucket"]; echo"</td><td>"; echo"<form action=\"http://www.\" method=\"POST\">"; $Colors = $row["Color"]; $options = explode(",", $Colors); while (list(,$Color) = each($options)){ $option .= "<OPTION>$Color</OPTION>\n"; } echo"<select name=\"Colors\">"; echo "$option"; echo"</select>"; echo"</td></tr>"; echo"</form> > It's usually a better idea to store this as a "relation": I'm afraid so. Thanks: Gerry Figueroa ----------------- Modern Confucious: Man who run behind car get exhausted.

« previous php.general (#38101) next »