doupang5433 2015-07-09 06:20
浏览 41
已采纳

php time()或mysql unix_timestamp()? [关闭]

Which is better to get the current time for inserting to database?

Efficiency, speed, ram consumption or any other factors which make a person to use this instead of that.

  • 写回答

1条回答 默认 最新

  • douvcpx6526 2015-07-09 06:27
    关注

    If you use real-time function like Now() in say MySQL query, The MySQL engine will execute the query real-time to give the real-time result instead of looking the result in cache first.

    So it is advisable not to use real time function directly in query, If alternate way is possible. Try to use php time() function.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?