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"; 


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

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.

8 Years
Discussion Span
Last Post by CFROG

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

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

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 
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.