导入命名空间和DB
namespace App\Http\Controllers;

use Illuminate\Support\Facades\DB;
public function index(){

//新增
$isok= DB::table('test')->insert([

'name'=>'123','pwd'=>'56'
]);

//修改
$isok=DB::table('test')
->where('name','rr')

->update([

'name'=>'sb','pwd'=>'sss'
]);

//查询
$isok=DB::table('test')->get();

//删除
$isok=DB::table('test')->delete();

var_dump($isok);

}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
  • 2021-11-29
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-16
  • 2021-08-13
  • 2021-09-18
  • 2022-02-22
  • 2021-11-17
  • 2021-06-05
  • 2022-12-23
相关资源
相似解决方案