Jump to content

Error inserting data into db via form


benjamin_boothe

Recommended Posts

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!!!
 
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.