June 13th, 2013, 10:53 AM
INSERT and Default Values of fields
I am new to the forums so please bare with me. I have an application written in PHP/MySQL. It worked fine until I upgraded from MySQL 5 to 5.6. The only problem seems to be the INSERTs. Previously I didn't need to specify default values on columns, I could do an insert such as:
INSERT INTO studentinfo (first_name,last_name,middle_initial,address,postal_code,home_phone,mobile_phone,home_email) VALUES ('Bob','Campbell','B','22 High Street','90210', 'xxx-xxxx','xxx-xxxx','email@example.com');
There are other columns being omitted in my INSERT and this worked fine before - these columns were left void and only had data entered after the fact with an UPDATE.
With my new install, all of the sudden MySQL complains that these other columns do not have default values. Will I need to go through each table and add default values for all of these columns? Or am I just missing something simple? I hope I was clear enough about my issue, again, my first time on the forums. Thanks very much in advance for any help offered.
June 13th, 2013, 12:06 PM
I've found the issue I believe. I changed the STRICT MODE in my.ini (windows) and all seems well. For anyone else who may come across this issue.
Thanks anyways folks !
June 13th, 2013, 12:23 PM
glad you were able to find a workaround
by the way...
bear with me = have patience
bare with me = let's get undressed together
June 13th, 2013, 12:49 PM
Oh, I know. I just like to troubleshoot MySQL issues in the nude.