Location: PHPKode > projects > Mozart > Mozart-0.0.4/getallprojs.inc
<?
// called from: included from all programs which offer a project list pull-down menu
// description: creates project listing pull-down menu
//

$ProjListSQL = "SELECT proj_id, name FROM project ORDER BY name";
$ProjList    = mysql_query($ProjListSQL);
 
?>
Associate with project <select name=SelectedProject>
<option value=0>None
<?
while ($projlist = mysql_fetch_array($ProjList)) {
	if ($projlist["proj_id"] == $projid["xproj_id"]) {
	    $selected = " selected";
	}
	else {
	    $selected = "";
	}
	printf("<option value=%s %s>%s", $projlist["proj_id"], $selected, $projlist["name"]);
}
?>
</select>
Return current item: Mozart