Could someone please help me and tell me why my php form isn't sending the data to the database.
The types are emp_no(int11)
, birth_date(date)
, first_name(varchar14)
, last_name(varchar16)
, gender(enum('M','F')
, hire_date(date)
// Checks to see if the save button was pressed and if so, then it should run the
query that inserts the data into the data fields specified.
if(isset($_POST['save'])) {
$sql = "INSERT INTO 'employees' ('emp_no', 'birth_date', 'first_name',
'last_name', 'gender', 'hire_date')
VALUES ('".$_POST['emp_no']."', '".$_POST['birth_date']."',
'".$_POST['first_name']."', '".$_POST['last_name']."',
'".$_POST['gender']."', '".$_POST['hire_date']."')";
$result = mysqli_query($conn, $sql);
}
code here: https://codepen.io/blackemr/pen/mjMgPQ