in addition to SgtLegend’s post your form must have an attribute called “action” and the value of action will be the name of the server side script that will receive the form data when submit is clicked and process it as SgtLegend described.
Or if it is a single field/column to store the date then you just concatenate the values posted to a single variable according to your date format in the table. Assuming the format YYYY-MM-DD:
$date = mysql_real_escape_string($_POST['year']);
$date .= '-' . mysql_real_escape_string($_POST['month']);
$date .= '-' . mysql_real_escape_string($_POST['day']);
// then insert the date into the table.
$sql = "INSERT INTO SET `date`='" . $date . "'";
What rajug posted is example code, to run the query you need to already have a MySQL connection setup and then use the [B]mysql_query/B function to run it. Personally i would recommend using MySQLi if your server supports it as its a lot better and easier to understand
ok
this is the table structure
CREATE TABLE IF NOT EXISTS mst_userinfo ( ID int(11) NOT NULL auto_increment, userID varchar(16) NOT NULL, password varchar(16) NOT NULL, user_name varchar(20) NOT NULL, user_sex tinyint(4) NOT NULL, user_birthday date NOT NULL, user_mail varchar(50) NOT NULL, ins_userID varchar(16) NOT NULL, ins_date date NOT NULL, upd_userID varchar(16) NOT NULL, upd_date date NOT NULL,
PRIMARY KEY (ID)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=85 ;
I assume the field to store your selected date is user_birthday:
$date = mysql_real_escape_string($_POST['year']);
$date .= '-' . mysql_real_escape_string($_POST['month']);
$date .= '-' . mysql_real_escape_string($_POST['day']);
// then insert the date into the table.
$sql = "INSERT INTO `mst_userinfo` SET `user_birthday`='" . $date . "'";
Setting rest of the fields are as usual I hope you know that.