![]() Topic awaiting preservation: MySQL NOW() (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: New Jersey, USA |
![]() 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 |
![]() 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 |
![]() Yeah a little search brought up this little function: |
Paranoid (IV) Inmate From: New Jersey, USA |
![]() Yea, that did the trick! |