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

$ContListSQL = "SELECT contact_id, first, last FROM contact ORDER BY last, first";
$ContList    = mysql_query($ContListSQL);
 
?>
Associate with contact <select name=SelectedContact>
<option value=0>None
<?
while ($contlist = mysql_fetch_array($ContList)) {
	if ($contlist["contact_id"] == $contid["xcont_id"]) {
	    $selected = " selected";
	}
	else {
	    $selected = "";
	}
	printf("<option value=%s %s>%s, %s", $contlist["contact_id"], $selected, $contlist["last"], $contlist["first"]);
}
?>
</select>
Return current item: Mozart