//数据库操作之原生插入数据
public function db()
{
// 插入数据
$result= Db::execute('insert into think_data(id,age) values(19,20);');
// 修改语句
$result=Db::execute('update student set `name` = "你好" where id = 16 ');
// 删除
$result=Db::execute('delete from student where id = 18');
// 查询
$result=Db::query('select * from student ');
dump($result);
}
//数据库操作之查询构造器
public function db()
{
//插入
$result=Db::table('student')->insert(['name'=>'nihao']);
//修改
$result=Db::table('student')->where('id',19)->update(['name'=>'你好']);
//删除
$result=Db::table('student')->where('id',16)->delete();
//查询
$result=Db::table('student')->where('id',15)->select();
dump($result);
}