Why can't you use something like:


if ($var){
<select name="name">
<?php
  $query ="SELECT DISTINCT part FROM table ORDER BY part";
  $result = mysql_query($query);

  while($row = mysql_fetch_array($result)){
    echo '<option value="'.$row[part].'">'.$row[part].'</option><br>';
  }
?>
</select>
}

or something of that nature .. will save as steve said a page refresh and will 
populate the select box given a certain condition.

Peter
>Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
>list-help: <mailto:[EMAIL PROTECTED]>
>list-unsubscribe: <mailto:[EMAIL PROTECTED]>
>list-post: <mailto:[EMAIL PROTECTED]>
>Delivered-To: mailing list [EMAIL PROTECTED]
>From: "Steve Werby" <[EMAIL PROTECTED]>
>To: "Tom Beidler" <[EMAIL PROTECTED]>, "php list" 
<[EMAIL PROTECTED]>
>Date: Tue, 7 Aug 2001 23:07:36 -0400
>MIME-Version: 1.0
>Content-Transfer-Encoding: 7bit
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
>Subject: Re: [PHP] sample or tutorial for conditional pulldown menus
>X-Mozilla-Status: 0000
>X-Mozilla-Status2: 00000000
>X-UIDL: f699c3809f815f98082e45324098a49c
>
>"Tom Beidler" <[EMAIL PROTECTED]> wrote:
>> I have a client that would like to duplicate something they've seen on one
>> of their competitor's web sites. It's for an automotive parts supplier and
>> they would like to build a search engine for different make, model, and
>year
>> applications. Since a picture is worth a thousand words here's a url to
>see
>> the site they would like to knock off;
>>
>>
>http://www.performanceproducts.com/shopper_profile.asp?mscssid=2K5UHTRR3UV28
>> MLG468UVDQR3F4T73P3
>>
>> They like that you could choose a year and a make, which jumps to a new
>page
>> with an additional pulldown menu for models associated with the selected
>> year and make. Some models even ask for a submodel. It's pretty cool but
>> it's in ASP and ssssllllllloooooooowwwwwww.
>
>Others on the list made good suggestions about the database structure.  The
>URL you referenced reloads the whole page.  I've seen other sites achieve
>the same functionality by loading the elements of the second, third and
>fourth select boxes into javascript arrays which and regenerate the contents
>of the dropdown boxes and make them visible based on the element selected in
>the parent select box.  This avoids a page reload, but forces the page to
>load all of the possible select box elements when it's first loaded - and it
>obviously requires javascript.  It might be a good alternative depending on
>your needs.  I've found that it only makes sense when very few target users
>will have javascript disabled and the potential contents of the select boxes
>are less extensive than make and model detail.
>
>--
>Steve Werby
>President, Befriend Internet Services LLC
>http://www.befriend.com/
>
>
>-- 
>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]
>


------------------------------------------------------
Peter Houchin
Sun Rentals STR Manager
Phone: 03 9329 1455
Fax:   03 9329 6755
[EMAIL PROTECTED]
http://www.sun.com.au/rentals
=========================================================
     _____                              __   /\
    /_/_/_\                            /  |_/  \
   /_/_/_    __  __  __   __          /         \
   \_/_/_\  /_/ /_/ /_/  /_/          \   _     /
 ___\_\_\/ /_/_/_/ /_//\/_/            \_/ \/\_/
 \_//_/_/ /_/_/_/ /_/ \/_/                    v
     ________   ________________________________________
    /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
   /_/_ _/_/ ______  __   __  /_/ ____      __     ______
  /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\    /_/    /_/_/_/
 /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
/_/    \_\/_/_/_/ /_/ \/_/ /_/ /_/    \_\/_/_/_//_/_/_/
=========================================================
Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
************* We rent the dot in .COM!  **************


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