Jump to content

[SOLVED] Best timestamp method to use?


acctman

Recommended Posts

What's the best Time/Date method to use when storing into a database? Mysql has a TIMESTAMP that will fill into automatically but there is also a time() that you can add during a php sql insert call.

 

any suggestion as to what i should use. right now i'm using the php time() and the entry into the db looks like this 1217123817

Link to comment
https://forums.phpfreaks.com/topic/116793-solved-best-timestamp-method-to-use/
Share on other sites

i tried using the now() and i'm receiving this error Fatal error: Call to undefined function: now()

 

        sql_query("INSERT INTO $logstable VALUES('$line[m_id]','$line[m_user]',".now().",'$ip') ".
"ON DUPLICATE KEY UPDATE log_user='$line[m_user]',log_time='".now()."',log_ip='$ip'");

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.