Correcting teacher:PHPz
Correction status:qualified
Teacher's comments:
$arr = ['Cno' => 8,'Cname' => '数学','Cpno' => 7, 'Ccredit' => 10];
Db::table('course')->insert($arr);
$arr = [['Cno' => 9,'Cname' => '数学','Cpno' => 7, 'Ccredit' => 10],
['Cno' => 10,'Cname' => '数学','Cpno' => 2, 'Ccredit' => 10]
];
Db::table('course')->insertAll($arr);
$arr = ['Cno' => 11,'Cname' => '数学','Cpno' => 7, 'Ccredit' => 10];
$res = Db::table('course')->insertGetId($arr);
echo $res;
$res = Db::table('course')->where('Cno',8)->delete();
查询一条数据
$res = Db::table('course')->where('Cno','2')->field('Cno')->find();
print_r($res);
查询多条数据
$res = Db::table('course')->where('Cno','2')->find();
print_r($res);
$res = Db::table('course')->where('Cno',8)->update($arr);