I can't see my dates in MySQL. Need some help.
Moderator: General Moderators
-
Genteel Beaux
- Forum Commoner
- Posts: 28
- Joined: Wed Nov 13, 2002 4:07 pm
- Location: Alabama
I can't see my dates in MySQL. Need some help.
I have my table set up so that it automatically enters the date and time in a field. At first, it was working fine. I could see the dates and the times. Now, all of the dates and times in each of the records are set back to the default. I don't know if I did anything. No matter what, all I get is 00000000000000 for timestamps and 0000-00-00 00:00:00 for data/time. Does anyone know what causes this?
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Have you checked to see what the dates and times look like before you put them into the database, MySQL will just put a default value into the field if the data is not formatted correctly. Has all the previous data also been affected? If so do you run any UPDATE SQL statements to alter dates and times that don't use the WHERE clause and thus affect all records.
Mac
Mac
-
Genteel Beaux
- Forum Commoner
- Posts: 28
- Joined: Wed Nov 13, 2002 4:07 pm
- Location: Alabama
I don't have any code referencing the timestamp at all. I did that so I wouldn't have to worry about doing it in the code. I'm just using an INSERT() statement to add a new record. At first, everything was working fine. Then eventually, all my previous records (timestamps) have changed back to the default values. I don't have an UPDATE() statement at all. Now, it doesn't matter when I add a new record. It is always 000000000000 or 0000-00-00 00:00:00.
-
Genteel Beaux
- Forum Commoner
- Posts: 28
- Joined: Wed Nov 13, 2002 4:07 pm
- Location: Alabama