Re: [PHP-DB] mysql and dropdown menus

2002-02-12 Thread Philippe COLLEU

Jeff,

I solved the problem by using a different frame for each drop down
menu. In my case I had 5 drop down menus interacting together and
selecting their values from the database.
Then I'm passing the value of each variable to the other frames
(affected by the selection) using a javascript function (called by
onchange in the select form). The same javascript function can also
check the value of all the different select forms displayed in
different frames...
To pass the value on to the next frame, I used :
var
mystr="http://mysite.com/myframe.php?1rstvariable=value1&2ndvariable=value2";;
wininfo = open(myStr, "theframename");

There might be a better solution though (I'm completely new to php)

Hope this helps

>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
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

--
Philippe Colleu
Instituteur ˆ l'ƒcole Franaise Les Grands Lacs, Kampala, Ouganda
"Classe des CM1/CM2" : 
"Photos d'Ouganda" : 
"Maths au CM" : 
"Grammaire au CM" : 

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] mysql and dropdown menus

2002-02-12 Thread Rick Emery

When you include $Select in your URL, did you remember to urlencode() it
first?  If no, the spaces will blow your URL away...very nasty...

BTW, it helps if you post code.

-Original Message-
From: jeff akerman [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 11, 2002 4:27 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mysql and dropdown menus


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

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php