0

Hey all,

Is there any way to check the time of insertion of a record. Means if i inserted a record in table on 03/21/2011 14:05:45 00:00 then is there any way to get this time after-wards

4
Contributors
11
Replies
12
Views
6 Years
Discussion Span
Last Post by debasisdas
0

MySQL has a date type called timestamp which records the time of the last update of a row. Add such a field to your table. This field changes with every update, though. If you want to keep the insertion time, use a datetime field and a trigger which updates this field with the value now() after insertion.

0

ok.. but it will work for the records inserted from now on what about the previously inserted records?

0

I don't know a way to find out past insertion times from the database. If you keep detailed database or web server logs you might be able to identify log entries with database records.

0

Then you need to write log of each and every transaction.

This is possible if number of tables are less and is highly impractical for a big database with hundreds of tables.

0

:( so there is no way to check the time of insertion of previously inserted records?

0

@debasisdas: You are not answering the question.
@gulbano: Yes there is - if you have database or web server logs which recorded the data entry time.

0

gulbano there is no other way to track a record other than keeping log of it add a column in you table and insert the datetime of each record insertion and you will be able to keep the log of the future record insertions

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.