I'm trying to insert some data to my database. The data contains also one date and time. So I need to insert that by converting into MySql DateTime format. I tried by using STR_TO_DATE, But it returns Date and Time Without AM OR PM.
Code Executed :
$sql = "INSERT into `projtemp` (`user_id`,`temp_name`,`processes`,`added`) VALUES('$uid','" . clean_data($tempName) . "','" . serialize($process) . "',STR_TO_DATE('$added', '%e/%c/%Y %r'))";
$result = $mysqli->query($sql) or die("Sql Error :" . $mysqli->error);
Query :
INSERT INTO `projtemp` (`user_id`,`temp_name`,`processes`,`added`) VALUES('0000000001','dsfwfwrfer','a:5:{i:0;s:11:"rgergergerg";i:1;s:29:"software requirement analysis";i:2;s:8:"regergre";i:3;s:16:"eqgerrrrrrrrrger";i:4;s:14:"ergergggggrreg";}',STR_TO_DATE('15/1/2014 11:34:21 AM', '%e/%c/%Y %r'))
Resultant Row :

I referred This Site, In that they says %r appends AM Or PM to Time But it didn't worked for me. Can anyone please help me to solve this issue.