Monday, 15 August 2011

php - Incorrect integer value '' for a MySQL column that's integer and allow null? -



php - Incorrect integer value '' for a MySQL column that's integer and allow null? -

i'm working on inserting csv table. don't have command on what's in csv , lot of fields blank. in first record instance, field "baths_full" empty (two commas back).

on production server running mysql 5.5.37, inserts record baths_full empty field. on local machine running mysql 5.6.19, gives me error:

[illuminate\database\queryexception] sqlstate[hy000]: general error: 1366 wrong integer value: '' column 'baths_full' @ row 1 (sql: insert `listings_queue` (`

the weird thing schema tables identical. in fact, used export of production machine create local database.

the field baths_full set tinyint, unsigned, allow null, default null. 1 thing add together looks in sql insert statement laravel creating, treating null values spaces. regardless, production machine runs script without problem locally won't run.

i found problem. local mysql running in strict mode. reply thread (general error: 1366 wrong integer value doctrine 2.1 , zend form update) fixed it.

php mysql sql laravel laravel-4

No comments:

Post a Comment