Re: Re: dynamic combo boxes
| From: | Scott Carr | Date: | Tue, 01 Oct 2002 21:17:32 +0000 |
| Subject: | Re: Re: dynamic combo boxes | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-16109@lists.php.net to get a copy of this message | ||
How are you trying to access the variable from the called page?
Make sure you use $_GET['tutname'] or $_POST['tutname'] to access the resulting
variable.
Also, what does your form tag state as method and post attribs?
--
Scott Carr
OpenOffice.org
Documentation Maintainer
http://documentation.openoffice.org/
Quoting Tim Blackwell <timblackwell@hotmail.com>:
> okay, i figured out the combo thing--code is below. it actually wasn't too
> difficult with some help!
>
> but, when i use tutname i get an undefined variable
>
> it works fine with the static combo that i was using?
>
> can you think of any reason for this?
>
> function load_combobox()
> {
> ?>
> <?
> @ $db = mysql_pconnect("localhost", "", "");
> if (!$db)
> {
> echo "Error: Could not connect to database. Please try again later.";
> exit;
> }
>
> mysql_select_db("tutorial");
> $options = "select distinct tutorialname from tutorial";
> $optres = mysql_query($options);
>
> $opt_results = mysql_num_rows($optres);
> echo "<select name=tutname>";
> for ($i=0; $i <$opt_results; $i++)
> {
> $optrow = mysql_fetch_array($optres);
> $optionval = stripslashes($optrow["tutorialname"]);
> echo "<option>$optionval</option>";
> echo "<br>";
> }
> echo "</select>";
> ?>
> <?
> }
>
>
> tim
> "Tim Blackwell" <timblackwell@hotmail.com> wrote in message
> news:20020930210133.8245.qmail@pb1.pair.com...
> > hi--i'm having some trouble autoloading a combo box with a mysql column.
> > could someone help please
> >
> > thanks,
> >
> > tim
> >
> >
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/