gpt4 book ai didi

php - SQLSTATE[22007] : Invalid datetime format: 1366 Incorrect integer value

转载 作者:行者123 更新时间:2023-11-29 16:47:19 27 4
gpt4 key购买 nike

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'Walking' for column 'excercise_type' at row 1

 public function up()
{
Schema::table('diabetic_records', function (Blueprint $table) {
$table->unsignedInteger('user_id')->nullable()->after('id');
$table->decimal('glucose_level',5,2)->nullable()->after('user_id');
$table->string('glucose_level_time')->nullable()->after('glucose_level');
$table->string('food_name')->nullable()->after('glucose_level_time');
$table->integer('food_amount')->nullable()->after('food_name');
$table->string('treatment')->nullable()->after('food_amount');
$table->string('medication_name')->nullable()->after('treatment');
$table->decimal('medication_dose',6,2)->nullable()->after('medication_name');
$table->string('medication_time')->nullable()->after('medication_dose');
$table->integer('excercise_type')->nullable()->after('medication_time');
$table->integer('excercise_duration')->nullable()->after('excercise_type');
});
}

最佳答案

数据库中exercise_type的数据类型必须已设置为DATETIME。将其更改为 int(11)。并且该值必须是整数,而不是字符串,即步行。这可能会解决您的问题。

关于php - SQLSTATE[22007] : Invalid datetime format: 1366 Incorrect integer value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53031487/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com