T
T
Torento203452021-04-07 23:06:38
SQL
Torento20345, 2021-04-07 23:06:38

Why does the empty input `piece` int(32) DEFAULT 1 get 0?

Why does the empty input `piece` int(32) DEFAULT 1 get 0 in the table?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Slava Rozhnev, 2021-04-07
@Torento20345

Because an empty string when converted to int(32) gives 0.
DEFAULT 1 will work only if the `piece` field is completely absent in the request.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question