I wonder if this can be done.
I have a select drop down box where the options are populated form a field in a database table something like this.
$SQL = "SELECT DISTINCT category FROM atable ORDER BY category";
$result = mysql_query($SQL);
echo "<select name='addCategory' size='6'>";
while ($db_field = mysql_fetch_assoc($result))
{
$getCategory = ($db_field['category']);
echo "<option value='".$getCategory."'
>".$getCategory."</option>";
}
echo "</select>";
What I want to do is have one of the values of the drop down box to be pre-selected if it matches an entry in a column in another table. Can anyone tell me how to do this or even if it can be done? I am a php beginner.