简体   繁体   English

LARAVEL:SQLSTATE [22007]:无效的日期时间格式:1292 截断不正确的 DOUBLE 值

[英]LARAVEL : SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value

I was trying creating a route to update the information in mysql table 'orcamento' and i am getting this error我正在尝试创建一条路线来更新 mysql 表“orcamento”中的信息,但出现此错误

   enter code here SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: '$orcamento->id' (SQL: update `orcamento` set `cliente` = joao, `vendedor` = Carlos, `descricao` = 2 peças de vidro, `valor` = 600, `orcamento`.`updated_at` = 2020-08-15 08:15:40 where (`id` = $orcamento->id))

the created_at and updated_at are builded by timestamps created_at 和 updated_at 由时间戳构建

enter code here    {
    Schema::create('orcamento', function (Blueprint $table) {
        $table->id();
        $table->text('vendedor');
        $table->text('cliente');
        $table->text('descricao');
        $table->double('valor',10,2);
        $table->timestamps();
    });
}


    

in route update is like this在路线更新是这样的

public function update(OrcamentoRequest $request, $id)
    {
        $orcamentos = ModelsOrcamentoModel::where(['id'=>$id])->update([
            'cliente'=>$request->cliente,
            'vendedor'=>$request->vendedor,
            'descricao'=>$request->descricao,
            'valor'=>$request->valor
        ]);
        return redirect('cadastros');
    }

Executing the dd function i got this执行 dd function 我得到了这个

'$orcamentos = ModelsOrcamentoModel::where(['id'=>$id])->dd($id,$request->valor);' 

"$orcamento->id" "600" "$orcamento->id" "600"

I was passing a wrong url in the form我在表格中传递了错误的 url

 <form action="{{url('orcamentos/'.$orcamento->id)}}" name="formEdit" id="formEdit" method="post">

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何修复&#39;SQLSTATE [22007]:无效的日期时间格式:1292截断了错误的DOUBLE值:&#39;X&#39; - How to fix 'SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: 'X'' Eloquent 删除 - SQLSTATE [22007]:无效的日期时间格式:1292 截断不正确的 DOUBLE 值: - Eloquent Delete - SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: SQLSTATE[22007]:无效的日期时间格式:1292 日期时间值不正确 - SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value Laravel 将时间戳保存为 DateTime - SQLSTATE[22007]:日期时间格式无效:1292 日期时间值不正确: - Timestamp being saved as DateTime by Laravel - SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: Laravel - SQLSTATE [22007]:无效的日期时间格式:1292 不正确的日期时间值:'1616818311712' - Laravel - SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '1616818311712' Laravel 8:SQLSTATE[22007]:无效的日期时间格式:1366 不正确的 integer 值 - Laravel 8: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value SQLSTATE [22007]:日期时间格式无效:1292 日期时间值不正确:“fotostudio”列的“28-01-2022 12:00”。“transaction_details” - SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '28-01-2022 12:00' for column `fotostudio`.`transaction_details` SQLSTATE [22007]:无效的日期时间格式:1292错误的日期时间值:第1行的“ created_at”列为“ 1970-01-01 00:00:01” - SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '1970-01-01 00:00:01' for column 'created_at' at row 1 “SQLSTATE[22007]:无效的日期时间格式:1292 不正确的日期时间值:&#39;2018&#39;列&#39;created_at&#39;在第 1 行(SQL:插入到`news` - "SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2018' for column 'created_at' at row 1 (SQL: insert into `news` SQLSTATE [22007]:无效的日期时间格式:1366不正确的整数值 - SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM