I know there are some answers in this topic but i'm fresh and can't manage to do it
I have insered Jquery UI DatePicker into PHP code but when I'm sending data to MySql I get this Error: Incorrect date value: '' for column 'date' at row 1
<html>
<head>
<script>
$(document).ready(function() {
$("#datepicker").datepicker({
dateFormat: 'yy-mm-dd'
});
})
</script>
</head>
</body>
<form action="query_insert.php" method="post">
<input type="text" id="datepicker">
<body>
query_insert.php:
<?php
$con = mysqli_connect("127.0.0.1", "root", "user", "pass");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="INSERT INTO expenses (date) VALUES ('$_POST[datepicker]'
?>
what I have to change to make it work?