php-db | 2001011

Re: [PHP-DB] Drop-down menus From: Pedro M. S. Oliveira (oliveira.pedro <email protected>)
Date: 01/04/01

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 <email protected>>
To: <php-db <email protected>>
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 <email protected>>
> Para: <php-db <email protected>>
> 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 <email protected>
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-db-unsubscribe <email protected>
> > For additional commands, e-mail: php-db-help <email protected>
> > To contact the list administrators, e-mail: php-list-admin <email protected>
> >
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe <email protected>
> For additional commands, e-mail: php-db-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>