Okay, I'm sure this is an easy one for you guys. You guys really know your stuff and it just seems easier sometimes to go straight to the source then to google and experiment for God knows how long. Forgive me for my ignorance of php. that's just the way it goes for a newb. Anyhow, to the point:

$sql="SELECT * FROM lookup_states"; 
$result=mysql_query($sql); 

$options=""; 

while ($row=mysql_fetch_array($result))
 { 
    $state=$row["state"]; 
    $options.="<OPTION VALUE=\"$state\">".$state; 
} 
?>
<SELECT NAME=state> 
<OPTION VALUE=0>Please Choose State 
<?=$options?> 
</SELECT>

This is what is have so far to populate a drop down with a list of states to choose from. Problem is that when you submit the form the state don't submit to the table.

// Short Variables

$fn = $_POST['first_name'];
$ln = $_POST['last_name'];
$city = $_POST['city'];
$state = $_POST['state_province']; //<---------------------------
$cntry = $_POST['country'];
$ocntry = $_POST['other_country'];
$dob = $_POST['dob'];
$em = $_POST['email'];
$x1 = $_POST['example'];
$x2 = $_POST['example2'];
$x3 = $_POST['example3'];

// Skip ahead a little 

// Insert fields into XINFO 
	 $sql = "INSERT INTO xinfo (date_submit, first_name, last_name, city, state_province, country, other_country, dob, email)
	  VALUE (CURDATE(), '$fn', '$ln', '$city', '$state', '$cntry', '$ocntry', '$dob', '$em')";

All other info but $state shows in the table. I'm sure it's a REALLY simple fix. Any help is appreciated.

Just a note: I did fix this part and it still don't work

<SELECT NAME=state_province>  //<----------------------
<OPTION VALUE=0>Please Choose State 
<?=$options?> 
</SELECT>

Dear Friend

check the table field name in database


Thanks and Regards

table field name is state_province

Guess it helped to walk away and look at it again with fresh eyes this morning. Works now and I was right, overlooking something very basic.

<SELECT NAME="state_province">  // Was missing " quotes " around NAME
<OPTION VALUE=0>Please Choose State 
<?=$options?> 
</SELECT>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.