Dynamic Jump Menu with selected option
Posted: Fri Apr 09, 2004 11:32 am
I am building a jump menu which is populated from a database. I am needing the jump menu to have a specific option be selected which is also provided from a seperate database. The populating of the menu is not a problem but I can not get the selected value part to work. Here is the code that was provided from a colleague which does not work.
Thanks for all replies
Code: Select all
$selectedproject=$timelistїprojectcategory];
$projectselectedї$selectedproject]="selected";
$projectquery="select * from projectcategories order by description asc";
$projectresult=mysql_query($projectquery);
$projectcount=mysql_num_rows($projectresult);
$projectcounter=0;
while ($projectcounter < $projectcount){
$project=mysql_fetch_array($projectresult);
$projectselector=$projectselectedї$projectїprojectcategory]];
$projectselectedї$projectselector]="selected";
$projectlist.="<option value="$projectїname]" $projectselector>$projectїdescription]</option>";
$projectcounter++;
}