Reputation:
Hello Friends this is my update query.
UPDATE bizz_investor_form set
Published_Published='publishedyes',
Published_Listed_and_Discoverable='listedanddiscoverableno',
Published_Describe_Start_Date='21-10-2013',
Describe_end_Date='30-10-2013'
WHERE user_id =136
When i run that query the date put in database like 0000-00-00 please help any one.
Upvotes: 0
Views: 101
Reputation: 3397
MySQL's default DATE field format is YYYY-MM-DD.
You can use DATE_FORMAT
DATE_FORMAT('1997-10-04 00:00:00', '%W %M %Y');
Upvotes: 0
Reputation: 5824
Change date to like.
$startdate = date("Y-m-d",strtotime('21-10-2013'));
$enddate = date("Y-m-d",strtotime('21-10-2013'));
then after write your query like.
"UPDATE bizz_investor_form set
Published_Published='publishedyes',
Published_Listed_and_Discoverable='listedanddiscoverableno',
Published_Describe_Start_Date='".$startdate."',
Describe_end_Date='".$enddate."'
WHERE user_id =136"
Upvotes: 0
Reputation: 1652
Set field type to DATE
or change value to 2013-10-30 00:00:00
(mysql dates format yyyy-mm-dd hh:mm:ss)
Upvotes: 0