DB facade实现CURD(操作数据库 手写原生SQL语句)
use Illuminate\Support\Facades\DB;
插入数据 (返回bool 插入是否成功) /$result = DB::insert('insert into student(name,age) values(?,?)', [ 'abcd',23 ]);
//更新数据(返回更新条数)
$num = DB::update('update student set age= ? where name=?)', [ 23,'abcd' ]);
//查询
DB::select('select * from student');
//删除(返回删除条数)
$num = DB::delete('delete from')