benjamin_boothe Posted August 22, 2006 Share Posted August 22, 2006 This is the error I am getting:[quote]Error inserting data - Incorrect date value: '' for column 'date_of_birth' at row 1 with query INSERT INTO policy_holder (id, title, first_name, surname, date_of_birth, uk_residency, marital_status, disability, employment_status, address_line_1, area, town, county, post_code, telephone_work, telephone_home, fax_number, email) VALUES ( NULL, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '')[/quote]I have used NULL as my id (auto_increment) value as this worked when I inserted a record via SQL command line client.I have used DATE as my character type 'Foramt: YYYY-MM-DD', which I have used. I cant see where the error is.Can somebody please help!!! Quote Link to comment Share on other sites More sharing options...
Yesideez Posted August 22, 2006 Share Posted August 22, 2006 Try this:[code]INSERT INTO policy_holder (id, title, first_name, surname, date_of_birth, uk_residency, marital_status, disability, employment_status, address_line_1, area, town, county, post_code, telephone_work, telephone_home, fax_number, email) VALUES ( NULL, '', '', '', '', NOW(), '', '', '', '', '', '', '', '', '', '', '', '')[/code]I'm not 100% sure but I don't think you can have an empty field that has a date/time datatype. Quote Link to comment Share on other sites More sharing options...
benjamin_boothe Posted August 22, 2006 Author Share Posted August 22, 2006 Thankyou very much BUT...It does add records to the db but, all the entries have come up as NULL barring the date_of_birth field that prints today's date. I want it to print the date that I put into the form. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.