$statusy = mysql_query("SELECT * FROM status",$db);
$rowstatusy = mysql_fetch_array($statusy);
echo '<form><select>';
do
{
$statusid = $rowstatusy["id"];
$statusname = $rowstatusy["statusname"];
printf ("<option value='%s' echo($statusname == 'active') ? 'selected' : '' )>%s</td>",$statusid,$statusname);
}
while ($rowstatusy = mysql_fetch_array($statusy));
echo '</select></form>';