Im using jQuery datepicker
the format of the datepicker is this 08/25/2012
i have errors when inserting to my database it insert only 0000-00-00 00 00 00
my codes is
<?php
$id = $_POST['id'];
$name = $_POST['name'];
$date = $_POST['date'];
$sql = mysql_query( "INSERT INTO user_date VALUE( '', '$name', '$date')" ) or die ( mysql_error() );
echo 'insert successful';
?>
im sure my insert is correct....
First of all store
$date=$_POST['your date field name'];
You must contain date in single cote (' ')
I hope it is helps.
You should consider creating a timestamp from that date witk mktime()
eg:
Get a date object from the jquery date picker using
For mysql the date needs to be in the proper format. One option which handles any timezone issues is to use moment.js
The simplest method is
Try Something like this..