Data truncated for column ‘status’ at row 1 [SOLVED]

Recently I encountered the following error:

Data truncated for column ‘status’ at row 1

This was specifically in a PHP based web hotel/reservations app that uses MySQL for the database backend. When trying to add a new dropdown option value of ‘departed’, the form submission would always fail with the aforementioned error.

Thankfully, the solution was easy once I checked the table/field definitions. The column ‘status’ was of type enum and thus needed to have the ‘departed’ value specifically enumerated in the field definition.

Showing the existing enum values for the status field

Showing the existing enum values for the status field

After adding that new value to the table field, all was well:

Add 'departed' as a new enum value for the status field

Add ‘departed’ as a new enum value for the status field

After the table change was saved, the application worked perfectly. 🙂 I also added a note in the PHP source code so that if anyone else ever needs to add a value there, they will know that the underlying table definition needs to be updated as well!

Top Search Terms:
  • mysql data truncated for column (13)
  • data truncated for column (9)
  • data truncated for column at row 1 (3)
  • data truncated for column mysql (3)
  • mysql data truncated for column enum (3)
  • data truncated for column 'status' at row 1 (2)
  • how do you adjust rows and columns on a dell laptop (2)
  • data truncated for column 'nfo' at row 1 (1)
  • data truncated at row 1 ,enum (1)
  • sql data truncated for column (1)

Leave a Reply

Your email address will not be published. Required fields are marked *