I want to insert a DateTime object in database where the column type is DateTime. How can I achieve this?
I am using this code:
$cdate = new DateTime('now')
$cd = $cdate->format('d/m/Y h:i:sa')
$udate = new DateTime('72 hours');
$ud = $udate->format('d/m/Y h:i:sa')
$insert = "insert into `winpc_user(mac_address,reg_date,updated_date,status,processor_name,ram_size,os_Name, os_Bits) values('$mac','$cdate','$udate','$stat','$proName','$rSize','$osName','$osBits')"