let us say you have a table of products. One of the attributes in this column is color and it contains a unique_id for a color. Another table you have is your color table and it has unique_id's for each color and color names.
If you call up product's details into a form and you want to list all the colors in the drop down and select the one that if currently selected for product you would do as follows
<?
$sql_one = "SELECT color FROM product WHERE product_id='$some_id'";
$sql_two="SELECT unique_id, display_name FROM color";
$result_one=mysql_query($sql_one,$conn);
$result_two=mysql_query($sql_two,$conn);
$row_one=mysql_fetch_array($result_one);
?>
<select name="selector">
<?
while($row_two=mysql_fetch_array($result_two) {
?>
<option name="<?=$row_two['unique_id']?>"<? if($row_two['unique_id']==$row_one['color']) echo("SELECTED"); ?>><?=$row_two['display_name']?></option>
<?
}
?>
</selected>
Hope this helps
Rob