简体   繁体   English

integer 值不正确:laravel 7 中第 1 行的列的“[]”

[英]Incorrect integer value: '[]' for column at row 1 in laravel 7

Hi guys i am trying to store id value from one table to another table column (topic_lookup_masters_id).大家好,我正在尝试将 id 值从一个表存储到另一个表列(topic_lookup_masters_id)。

so far i have made a join query and trying to get that id..so while storing i am getting error as到目前为止,我已经进行了联接查询并尝试获取该 ID ..所以在存储时我收到错误

General error: 1366 Incorrect integer value: '[]' for column 'topic_lookup_master_id' at row 1 

Here is my store function:这是我的商店 function:

$Topic_id = DB::table('topic_lookup_masters')
    ->join('qtype_lookup_masters', 'qlm_topic_id', '=', 'topic_lookup_masters.tlm_topic_id')
    ->select('topic_lookup_masters.id')
    ->get();

$qtype_lookup_master = new Qtype_lookup_master();
$qtype_lookup_master->topic_lookup_master_id = $Topic_id;

Tried using the type cast as (int) but still its not working.尝试使用类型转换为 (int) 但仍然无法正常工作。

Probably you try to populate the 'topic_lookup_masters_id' with a string or with null.可能您尝试使用字符串或 null 填充“topic_lookup_masters_id”。 Check if the associated value is int.检查关联的值是否为 int。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM