A
A
Al Capone2020-09-06 17:54:06
MySQL
Al Capone, 2020-09-06 17:54:06

Why does it give such an error when adding to the database after submitting the form?

Database Exception - yii\db\Exception
SQLSTATE[HY000]: General error: 1364 Field 'auth_key' doesn't have a default value
The SQL being executed was: INSERT INTO `user` (`email`, `password`, `code `) VALUES ('[email protected]', '$2y$13$1ljpJOqVd.w69P.M/R1tK.PsbyAP3lYL2bSHa05yOxDnxFFGmu9wa', '3PteL1biWt')
Error Info: Array
(
[0] => HY000
[1] => 1364
[ 2] => Field 'auth_key' doesn't have a default value
)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Al Capone, 2020-09-06
@anonim89

the issue is resolved: in the database it was necessary to set the default value NULL in the auth_key cell

R
Ruslan., 2020-09-06
@LaRN

The user table has an auth_key field. This field is not set to a value in your INSERT INTO code and is not set to a default value when the table is created. Hence the error.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question