The webhosting I use has enabled StrictMode for the Databases. All my php scripts now stopped working because they report I haven’t defined a default value for some columns.
As I have a lot of columns in a lot of tables, is there a way to set all the columns with “default value = none” with “default value = NULL” ?
In this way it won’t report me the error anymore.
Of course, If there’s another (better) way, I am available for it.
I tried looking on the net, but I couldn’t find anything suitable for this case.
2
Answers
you can alter column
A general approach here which should work for each column causing an error would be to set a default value, and then maybe do an update to backfill records missing a value.
And here is the update:
You are not required to do this update, but it might make sense to bring older records missing values in line with what newer records would look like.