我可以使用任何函数来获取我的专栏thread_id
中的最后一个插入值吗?
$result = DB::insert("Insert Into $this->table (thread_id, sender_id, subject, message, date_sent)
Select COALESCE(max(thread_id),0)+1 , ? , concat('Re: ',subject), ? , now() FROM $this->table Limit 1",array( $sender_id , $message) );
类似于insertGetId
答案 0 :(得分:1)
您必须自己执行其他查询:
$id = DB::table($this->table)->insertGetId('...');
$thread_id = DB::table($this->table)->where('id', $id)->pluck('thread_id');