Hi
I have coded the following which creates me a database driven drop down menu, however i want to be able have a default option, which is automatically selected based on the value of a varaible.
Any help would be great.
<?
php
$query = "select scriptname from script_summary";
$result = mysql_query ($query) or die (mysql_error());
echo "<td><b>Please Select A SCRIPT:</b></td> <td><SELECT name=\"scriptname\">";
if (mysql_num_rows($result)>0)
{
while($row=mysql_fetch_array($result))
{
echo "<option value=\"$row[scriptname]\">$row[scriptname]</option>";
}
}
echo "</SELECT></td>";
?>
Thanks in advance.