99re热这里只有精品视频,7777色鬼xxxx欧美色妇,国产成人精品一区二三区在线观看,内射爽无广熟女亚洲,精品人妻av一区二区三区

添加

2018-02-24 15:52 更新

添加數(shù)據(jù)進(jìn)數(shù)據(jù)表

DB::table('users')->insert(
    ['email' => 'john@example.com', 'votes' => 0]
);

添加自動遞增 (Auto-Incrementing) ID 的數(shù)據(jù)至數(shù)據(jù)表

如果數(shù)據(jù)表有自動遞增的ID,可以使用 insertGetId 添加數(shù)據(jù)并返回該 ID:

$id = DB::table('users')->insertGetId(
    ['email' => 'john@example.com', 'votes' => 0]
);

注意: 當(dāng)使用 PostgreSQL 時(shí),insertGetId 方法會預(yù)期自動增加的字段是以「id」為命名。

添加多個(gè)數(shù)據(jù)進(jìn)數(shù)據(jù)表

DB::table('users')->insert([
    ['email' => 'taylor@example.com', 'votes' => 0],
    ['email' => 'dayle@example.com', 'votes' => 0]
]);
以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號