my date type is date
and the data is 2010-08-01
I convert from Y-m-d to d-m-Y when echo
output - 01-08-2010
echo code
<td width="50%" class="pk_2"><input name="personal_ic_from" type="text" class="tcal" id="personal_ic_from" value="<?php
echo date_create($personal_ic_from)->format('d-m-Y');
?>" readonly="readonly"/>
</td>
what should I add on my update query to convert from d-m-Y to Y-m-d. I found that my database cant store the new date data because the database format is date
Y-m-d
update code
<?php
$personal_ic_from = $_POST['personal_ic_from'];
mysql_query("UPDATE personal_id_ic SET personal_ic_from = '".mysql_real_escape_string($_POST["personal_ic_from"])."' WHERE LAS_login_id = '".mysql_real_escape_string($_POST["LAS_login_id"])."'");
?>