Topic awaiting preservation: MySQL NOW() |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 06-28-2002 01:27
I want to have a field in my mysql table that holds either a 'datetime' or a 'timestamp' to keep track of the creation date of the data inserted. I didn't want to use the TIMESTAMP field type because unless you set it to itself in any subsequent updates to the row of data, it will automatically put in the current timestamp again. code: $sql = "INSERT INTO articles (title, description, date) values('$title', '$description', 'NOW()')";
|
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 06-28-2002 01:51
Well the #1 thought without checking the NOW() function is that you have it escaped in single quotes. |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 06-28-2002 01:54
Yeah a little search brought up this little function: |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 06-28-2002 02:07
Yea, that did the trick! |