Tell me where was wrong in comparison with the date:

$today = date("Ymd"); UPDATE modx_shopkeeper3_orders SET gotov = 1 WHERE status in (1,6,7) and userid = 2 and DATE_FORMAT(date,'%Y-%m-%d')=DATE_FORMAT(".$today.",'%Y-%m-%d') 

The date in the database is in this form 2017-07-15 14:56:34 , I need to compare without time.

  • ...and what is wrong? and who is mo.date ? - Aleksey Shimanskyj
  • Oh, I forgot to remove mo. but everything without it does not work, does not update the field - Aslero
  • and everything figured out, DATE_FORMAT (". $ today.", '% Y-% m-% d') you just need to '". $ today."' ' - Aslero
  • I just wanted to write about it ... - Alexey Shimansky
  • 2
    in general, and DATE_FORMAT not needed ... you can use DATE - Alexey Shimansky

0