The line

     echo "<br>";

has no effect except filling space in the file...

To get a value try

        echo "<option value='$optionval'>$optionval</option>";

Cheers...
Luis Ferro



Tim Blackwell wrote:

>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" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>  
>
>>hi--i'm having some trouble autoloading a combo box with a mysql column.
>>could someone help please
>>
>>thanks,
>>
>>tim
>>
>>
>>    
>>
>
>
>
>  
>



---
[This E-mail scanned for viruses by Declude Virus]


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

Reply via email to