Re: pulldown population not getting the last value
| From: | Jason Stechschulte | Date: | Mon, 19 Mar 2001 15:08:36 +0000 |
| Subject: | Re: pulldown population not getting the last value | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-44563@lists.php.net to get a copy of this message | ||
On Sun, Mar 18, 2001 at 05:38:36PM -0800, Tom Beidler wrote:
> I'm trying to create a pulldown menu with distinct names from the found set.
> For some reason I never get the last name. Here's my code;
>
> $contact_query = "SELECT DISTINCT name FROM request"
> . " WHERE id <= '5' OR demo_id = '$demo_id'"
> . " ORDER BY name";
> $contact_result = mysql_query ($contact_query)
> or die ("Cannot build contact");
>
> while ($contact_row = mysql_fetch_array ($contact_result))
> {
> $name = $contact_row["name"];
> $option_contact .= "<OPTION
> value=\"$name\">$name</OPTION>\n";
> }
>
> What gives?
I have not seen anything wrong with this portion of code. Have you
tried echoing $contact_row["name"] inside the loop to make sure this is
the portion of your code that is broken?
--
Jason Stechschulte
jpstech@unoh.edu
--
All language designers are arrogant. Goes with the territory... :-)
-- Larry Wall in <1991Jul13.010945.19157@netlabs.com