I am wanting to capture my post value and use it in my sql query. When I try this syntax NetBeans shows it is invalid syntax, but I am not sure how to fix it. What should I change so this becomes valid syntax (the issue is the query itself)
<html>
<div>
<div style="margin:10px;min-width: 200px;">Start Date: <input type="date" name="date_from" id="date_from"></div>
<div style="margin:10px;min-width: 200px;">End Date: <input type="date" name="date_to" id="date_to"></div>
</div>
</html>
<?php
if (!isset($_POST['submitbutton'])) die();
{
$query = "Select * from helper where hiredate >= '" . $_POST['date_from'] . "'" AND hiredate <= '" . DATEADD(DAY,1,$_POST['date_to']) . "'";
}
?>