Good day. How to add a date through PHP to MySQL ?.
I read dozens of articles in Google and on this site, but nothing helped.
If I write date('Ym-d'); - date adds.
If I write date('Ymd H:i:s'); - neither the date nor the time does not add.
Everyone writes that with date('Ymd H:i:s') everything works for everyone, but I don’t, I don’t understand why.
Yes, I could create a table in the database ( CURRENT_TIMESTAMP ) and would not be steamed, but this does not suit me, because after sending the date I’m checking for a duplicate on duplicate key update , if I already have such a record, I just need to update the date and all
Thanks in advance to everyone for their help.
insert into table(...) values(...,now()) on duplicate key update set dt=now()- Mike