You need to reset:

$option = '';

before each product.

So, inside the while(...mysql_fetch_row()) loop, but outside the
while(...$colors) loop.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Gerry <[EMAIL PROTECTED]>
To: Richard Lynch <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, February 04, 2001 10:23 AM
Subject: Re: [PHP] Select list with PHP


> 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.
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to