Jump to content

[SOLVED] MySQL now() vs php date


Prodigal Son

Recommended Posts

From a documentation point of view, using NOW() for current time, or CURDATE() for current date, tells anyone looking at you query code that the query is always based on the current time or date.

 

If there is a '$date' variable in there it could be any date or time and they then have to refer to occurences in the code where the query is called to find that the current date/time is being passed to the query.

 

Conversely, using NOW() or CURDATE() in a query that is always based on the current date/time saves you having to construct it in PHP before calling the query.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.