require_once('./db-connect.php');
$f_name = $_POST['f_name'];
$s_name = $_POST['s_name'];
$m_name = $_POST['m_name'];
$position = $_POST['list-position'];
$sql = 'INSERT INTO employees (first_name, second_name, middle_name, id_position) VALUES ('.$f_name.', '.$s_name.', '.$m_name.', '.$position.')';
$query = $db->prepare('INSERT INTO employees (first_name, second_name, middle_name, id_position)
VALUES (:first_name, :second_name, :middle_name, :id_position');
$query->execute(
[
':first_name' => $f_name,
':second_name' => $s_name,
':middle_name' => $m_name,
':id_position' => $position
]);
$sql = 'INSERT INTO employees (first_name, second_name, middle_name, id_position) VALUES (?, ?, ?, ?)';
$pdo->prepare($sql)->execute([$_POST['f_name'], $_POST['s_name'], $_POST['m_name'], $_POST['list-position']]);