this is relatively simple... first of all you gonna have to setup database. then do this (code works with mysql database, you can just substitute equivalent postgresql functions):
<?
$conn = mysql_connect('localhost','***','***');
//***, *** username and password to database
mysql_select_db('database_name',$conn);
//selecting database
?>
<form method="POST" action="somepage.php">
<select name="STATE_NAME" size="1">
<?
$sql = "SELECT DISTINCT STATE_NAME FROM STATES";
$result = mysql_query($sql,$conn);
while($row = mysql_fetch_object($result)) { ?>
<option value="<? echo $row->STATE_NAME; ?>"> <? echo $row->STATE_NAME; ?> </option>
<? } ?>
</select>
<input type="submit" value="Submit">
</form>
hope that helped :D:)

:D:D:D
the genuine genius