dprichard
06-29-2007, 03:40 PM
I have a drop down box and am trying to figure out how to select the initial value from the results of a query on my page. Any help would be greatly appreciated.
Here is my dropdown:
<select name="dcstatus" id="dcstatus">
<option value="">Please Choose One</option>
<?php do { ?><option value="<?php echo $row_folder_status['dcstatusid']; ?>"><?php echo $row_folder_status['dcstatusname']; ?></option><?php } while ($row_folder_status = mysql_fetch_array($folder_status)); ?>
</select>
Here is my query:
$folder = mysql_query("SELECT dcname, dcdescription, dcparent, dccreator, dcstatus FROM dcmain WHERE dcid = '$dcid'") or die(mysql_error());
$row_folder = mysql_fetch_array($folder);
$row_folder_total = mysql_num_rows($folder);
Here is my dropdown:
<select name="dcstatus" id="dcstatus">
<option value="">Please Choose One</option>
<?php do { ?><option value="<?php echo $row_folder_status['dcstatusid']; ?>"><?php echo $row_folder_status['dcstatusname']; ?></option><?php } while ($row_folder_status = mysql_fetch_array($folder_status)); ?>
</select>
Here is my query:
$folder = mysql_query("SELECT dcname, dcdescription, dcparent, dccreator, dcstatus FROM dcmain WHERE dcid = '$dcid'") or die(mysql_error());
$row_folder = mysql_fetch_array($folder);
$row_folder_total = mysql_num_rows($folder);