1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
<?php namespace App; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\DB; class Member extends Model { //代码格式化快捷键:command + alt + L. // public static function getMember(){ // return 'This is Member.getMember'; // } // public static function getMember(){ // $member = DB::select('select * from student'); // var_dump($member); // } // public static function getMember(){ // $info = DB::select('select * from student'); // dd($info); // } // public static function getMember(){ // $info = DB::select('select * from student where id > ? and sex = ?', // [1002,1]); // dd($info); // } // public static function getMember() // { // $info = DB::select('select * from student'); // dd($info); // } // public static function getMember() // { // $info = DB::select('select * from student where age > ?', // [27]); // dd($info); // } // public static function getMember() // { // $info = DB::insert('insert into student(name,age) VALUES(?,?) ', // ['SAP',35]); // // var_dump($info); // } // public static function getMember() // { // $info = DB::insert('insert into student(name,age,sex) VALUES(?,?,?) ', // ['Oracle', 30, 1]); // } // public static function getMember() // { // $info = DB::update('update student set name = ? where id = ?', // ['Microsoft', 1009]); // } public static function getMember() { $info = DB::delete('delete from student where id < ?', [1003]); var_dump($info); } } |
本文作者: GavinDong
版权属于: GavinDong博客
文章链接: https://gavindong.com/1873.html
如果使用过程中遇到问题,可 **点击此处** 交流沟通。
版权所有,转载时必须以链接形式注明作者和原始出处及本声明。