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
>
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php