摘要: 1.查询构造器-新增数据 //添加单条数据 $result = DB::table('student')->insert([ 'name' => 'kevin', 'age' => '18', ]); //添加单条数据并返回自增ID值 $result = DB::table('student')-> 阅读全文
posted @ 2022-01-09 16:26 saneim 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 关于数据表的创建和对应的model请见上一篇博客。 1.添加数据 DB::insert('insert into student (name,sex,age) value (?,?,?)', ['jack', 2, 19]); 2.查询数据 DB::select('select * from stu 阅读全文
posted @ 2022-01-09 16:09 saneim 阅读(1566) 评论(0) 推荐(0) 编辑