Resource icon

[RESOLVED] MySQL error : "Incorrect integer value" for column id at row 1

Tackling MySQL error is somewhat hectic. Let me say with an instance: If a user tries to change from four-year-old amazon instance to ERP software using the local server but the database engine was planned with MySQL. Everything goes well, when the test started no response claimed from the software it simply throws the error as

Code:
Incorrect integer value: ‘ ‘  for column ‘a_column_name’ at row 1
This is just an example to show you how will you get the MySQL error further. Let me explain in code concept: If the string value is assigned to PHP script, that too the empty string is assigned meanly then you will get the error code Incorrect integer value….

Behind this scenario, the script which is running tries to update or insert the row with the entry integer may be with values assigning it as default ( 0 or Null, AUTO_INCREMENT) value.

Due to STRICT mode, MySQL doesn’t disturb this action and so the reason would be SQL_MODE.

But don’t analyse this as error. Just search on the line edit my.ini

Code:
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
Now keep the value as empty string such as

Code:
sql_mode=""
Save all the process and confirm with my.ini. Now, finally restart the MySQL

After this, the empty string value will be changed to default automatically. It implies when you created the table default value will be set at the column and how the designated value is analysed for integer data type.

Now, you would have understood how the default value plays main role in all MySQL database. It implies database engine is all rounders in all sector. Some users may find difficult to understand the coding part but once if they learnt it then it would be very easy for all users.
Author
bhawanisingh
Views
59,410
First release
Last update
Rating
0.00 star(s) 0 ratings
Top