これは前にErr変数をnullに宣言していますか?
<?php
if (! isset ($_POST ['yearOfBirth']) || empty ($_POST ['yearOfBirth'])) {
$isFormValid = FALSE;
$yearErr = "Please select year";
if (! isset ($_POST ['monthOfBirth']) || empty ($_POST ['monthOfBirth'])) {
$isFormValid = FALSE;
$monthErr = "Please select month";
if (! isset ($_POST ['dayOfBirth']) || empty ($_POST ['dayOfBirth'])) {
$isFormValid = FALSE;
$dateErr = "Please complete the dob";
$dob = $_POST ['yearOfBirth'] . "-" . $_POST ['monthOfBirth'] . "-" . $_POST ['dayOfBirth'];
// exit(print_r($_POST));
}
}
}
---------------------------
Here is the SQL part.
----------------------------------
$dob = $_POST["yearOfBirth"] . "-" . $_POST["monthOfBirth"] . "-" . $_POST["dayOfBirth"];
$register = "INSERT INTO tablename(dob,)
VALUES('$dob',)";
これは
を役に立てば幸い