Re: pulldown population not getting the last value
| From: | Tom Beidler | Date: | Mon, 19 Mar 2001 17:59:37 +0000 |
| Subject: | Re: pulldown population not getting the last value | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-44604@lists.php.net to get a copy of this message | ||
on 3/19/01 7:08 AM, Jason Stechschulte at jpstech@unoh.edu wrote:
> 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
Urgh! I forgot to "globalize" the cookie $demo_id! Amazing how it's always
something simple!
>>.>>.>>>.>>>>>.>>>>>>>>>.>>>>>>>>
Tom Beidler
Orbit Tech Services
805.682.8972 (phone)
805.682.5833 (fax)
tom@orbittechservices.com
http://www.orbittechservices.com/
>>.>>.>>>.>>>>>.>>>>>>>>>.>>>>>>>>