1366 MySQL Origin: Data Last updated 15 Oct 2026

MySQL ERROR 1366 (HY000): Incorrect integer value: '' for column 'x' at row 1

An empty string or non-numeric text was inserted into an INT column under strict mode.

Exact message you may see Incorrect integer valueIncorrect decimal value
Seen on: MySQL

Meaning

Forms send '' for empty numeric fields. Strict mode (default since 5.7) rejects it instead of storing 0.

Common causes

  • Empty string for numeric fields
  • Non-numeric text
  • Old code relying on non-strict MySQL

⚡ Quick fix

  1. Convert '' to NULL (or 0) in the application
  2. Validate numeric input
  3. Don’t disable strict mode

Detailed fix by platform

PHP

  1. $qty = $_POST['qty'] === '' ? null : (int) $_POST['qty'];

How to diagnose

  1. Value — What was sent?
  2. Column — Nullable?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

1048 — MySQL ERROR 1048 (23000): Column 'x' cannot be null (MySQL)10481264 — MySQL ERROR 1264 (22003): Out of range value for column 'x' at row 1 (MySQL)12641292 — MySQL ERROR 1292 (22007): Incorrect datetime value: 'x' for column 'y' (MySQL)12921366 — MySQL ERROR 1366: Incorrect string value: '\xF0\x9F\x98\x80' for column (MySQL)13661690 — MySQL ERROR 1690 (22003): BIGINT UNSIGNED value is out of range (MySQL)169022001 — ERROR: value too long for type character varying(255) (PostgreSQL)2200122P02 — ERROR: invalid input syntax for type integer: "abc" (PostgreSQL)22P0222P02 uuid — ERROR: invalid input syntax for type uuid: "x" (PostgreSQL)22P02 uuid1366

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.