Re: mysql and dropdown menus
| From: | Raymond Lilleodegard | Date: | Tue, 12 Feb 2002 00:08:50 +0000 |
| Subject: | Re: mysql and dropdown menus | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16836@lists.php.net to get a copy of this message | ||
Hi Jeff!
If I understand you correct, you may do this by using a hidden field that
stores the select variable. It is also possible to set a seesion variable I
guess.
Regards Raymond
"Jeff Akerman" <monkeytail@lycos.com> wrote in message
news:KCHGOOFAAPILABAA@mailcity.com...
> I'm working on a webpage that will display a list of names and locations
held within a mysql db. Once the list is displayed, the names and locations
are sortable Ascending and Descending by clicking on the column title.
However, I'm trying to incorporate a drop down menu that will allow you to
specify the location you want to view so that you don't have to look at the
entire list, only those with the selected location.
>
> Within my dropdown menu the variable name is 'Select' which I then include
in a mysql_query WHERE statement. For example mysql_query(SELECT * from
data WHERE state = '$Select' $orderby $sortorder) the $orderby and
$sortorder are strings which contain the statements for ordering and
sorting. Very similar to Chap. 11 of PHP4 for Beginners (Wrox).
>
> I can get this to display correctly when originally done but if I want to
the sort the smaller list, I cannot figure out how to get the $Select
variable to continue to hold the correct state. What has been happening is
when I click to sort either ascending or descending, that variable ends up
with nothing in it and my results are way off. I'm using
$PHP_SELF?show_names&state=$Select (show_names is a function for listing
the names and locations) but the $Select variable seems to be emptying out
when I do this.
>
> My dropdown list is not contained within the function. Is this a problem?
>
> Hope this made sense.
>
> Any suggestions would be greatly appreciated.
>
> Thanks,
>
> Jeff
>
>
> Go Get It!
> Send FREE Valentine eCards with Lycos Greetings
> http://greetings.lycos.com