Re: Drop-down menus

From: Date: Thu, 04 Jan 2001 20:11:53 +0000
Subject: Re: Drop-down menus
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-5592@lists.php.net to get a copy of this message
hello all, this is a piece of code i made, it works... some of the vars name are in portuguese. my first language. as the query but if you know a bit of sql and how php you will put this working fast $db = mysql_connect ($host,$mysqluser,$mysqlpass); mysql_select_db ($database,$db); $query="select disponibilidade from disponibilidade"; $values = mysql_query ( $query,$db); if (!$values) { echo "erro"; exit; } $opcao = mysql_fetch_array ($values); do { $disp[$i]=$opcao[disponibilidade]; $i++; } while ($opcao=mysql_fetch_array ($values)); $options = join("<option>",$disp); $combodisp = ("<select name=dropdown> <option>$options</option></select>"); echo $combodisp; and voila you will have a dinamic combo display ----- Original Message ----- From: "JJeffman" <jjeffmanweb@conex.com.br> To: <php-db@lists.php.net> Sent: Wednesday, January 03, 2001 3:50 PM Subject: Re: [PHP-DB] Drop-down menus > If the options are previously known you souldn't run another script you can > use dhtml instead, and the page shoundn't be reloaded. > > Jayme. > > http://www.conex.com.br/jjeffman > > > > -----Mensagem Original----- > De: Julio Cuz, Jr. <jcuz@rccd.cc.ca.us> > Para: <php-db@lists.php.net> > Enviada em: terça-feira, 2 de janeiro de 2001 18:13 > Assunto: [PHP-DB] Drop-down menus > > > > Hi-- > > > > Let's say I have two (2) drop down menus (time-in & time-out, for > example), > > each one has the same options (7:00 a.m., 7:30 a.m., 8:00 a.m., 8:30 a.m, > > 9:00 a.m., so on...). What I would like to do is this: > > > > * When the user selects an item from drop-down menu #1 (time-in) and then > > moves to the next field, drop-down menu #2 (time-out) should AUTOMATICALLY > > change to the same option drop-down menu #1 changed to. I guess you can > > see the obvious reasoning: If the user selects 8:30 a.m. on menu #1 > > (time-in) , then the system should select 8:30 a.m. as the option on menu > > #2 (time-out). > > > > Thanks a lot! > > > > Julio Cuz, Jr. > > Riverside Community College > > jcuz@rccd.cc.ca.us > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > For additional commands, e-mail: php-db-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.db (#5592) next »