MySQL Forums
Forum List  »  PHP

insert error after updating sql server
Posted by: brett kentwell
Date: July 28, 2018 04:46AM

I recently updated my computer and installed the latest version of wamp server which has sql server version 5.7.21 Before updating I exported my databases from wamp to a flashdrive using phpmyadmin then reimported them after the update.
I am now having an issue on all my web applications where the insert function is returning an error

AN example insert staement :
INSERT INTO take5 (id, id_job, id_user, swmscheck, hazardcheck, firstAid, heights, liveParts, ppe, manualHandling, checkDate, checktime, hazards) VALUES ('', '21', '1', 'yes', 'no', 'yes', 'no', 'no', 'yes', 'yes', '28-07-2018', '1532768908', '')
returns the error : Database query failed.Incorrect integer value: '' for column 'id' at row 1.

this error has only started since the update and only occurs when passing an empty string into the auto increment field of id. If I remove that field from the field list and the value from the value it works fine.
The problem is that the sql statement is generated dynamically on all my sites and and there are a dozen or so php objects that would have to be reworked to remove the id field when creating the statement. This would then affect update queries that use the same function when instantiating an object.

Is there some setting change in this version of sql server.

I have tried searching for answers but can not seem, to find anything.

Any help would be greatly appreciated

Options: ReplyQuote

Written By
insert error after updating sql server
July 28, 2018 04:46AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.