When I executed this query everything is loaded properly into the table, except for the first item in the first row of the log file.

MySQL gives me the following warning: "Out of range value for column 'date' at row 1"

When I run "SELECT date from Error_Log" I can see that for the first row in the table, it just inserted 0000-00-00 00:00:00 instead of 2010-03-20 13:00:22. However, it got the second and third dates correct.

I thought it might be a file encoding issue, but the file is saved in 'UTF8' which is what I also using in MySQL.

Anyone have any ideas of what might be causing the first date not to be inserted properly?

crmalibu
—
2010-03-20T18:01:41Z —
#2

The answer to your question will come from inspecting the file contents. If I were to guess, you probably have saved the file with a byte order mark. Your text editor probably has the option to save as utf8 without BOM.

anonymousdude
—
2010-03-20T18:30:42Z —
#3

crmalibu said:

The answer to your question will come from inspecting the file contents. If I were to guess, you probably have saved the file with a byte order mark. Your text editor probably has the option to save as utf8 without BOM.

Thanks for the tip. Looks like you were right and it was something my text editor did.

The file was actually originally created by the php error_log function.However, i opened it in notepad and switched the encoding from ANSI to UTF8 and that seemed to have caused the problem.

I deleted the file and started over, letting the error_log create a new file, this time leaving it in ANSI encoding and it works properly now. Kind of weird that UTF8 would cause that problem though.