3
對於此更新查詢,我試圖在運行它之後獲取id。Laravel從更新查詢獲取記錄ID
$results = DB::table('testDB123.users')
->where('fbID', '=', $x['id'])
->update([
'updated_at' => $x['currDate'],
'fbFirstName' => $x['firstName'],
'fbLastName' => $x['lastName']
]
);
沒有運氣$results->id
有什麼類似insertGetId
用於更新查詢試過這種?
$id = DB::table($table1)->insertGetId([...])