# Equal to (=)
$select = Db::table('shop_goods')- > ;where('id','=','1')->select();
print_r($select->toArray());
# 等しくない (<>)
$select = Db::table('shop_goods')->where('id','<>',' 2')->select();
print_r($select->toArray());
より大きい (>)
$select = Db::table('shop_goods')->where('id','>','3')->select();
print_r( $select->toArray());
# 以上 (>=)
$select = Db::table( 'shop_goods' )->where('id','>=','4')->select();
print_r($select->toArray());
# 未満 (<)
$select = Db::table('shop_goods')->where('id','< ','5 ')->select();
print_r($select->toArray());
以下to (<=)
$select = Db::table('shop_goods')->where('id','<=','6')->select();
print_r($select->toArray());
# where
$select = Db::table(' shop_goods')
->where('id','>','3')
->where('id','<','8' )
->select();
print_r($select->toArray());
いいね
$select = Db::table('shop_goods')->where('title','like','%dress%')->select();
print_r( $select-> ;toArray());
# 気に入らない
$select = Db::table('shop_goods')->where ('title' ,'not like','%dress%')->select();
print_r($select->toArray());
# BETWEEN
$select = Db::table('shop_goods')->where('id','between','6,10')->select( );
print_r($select->toArray());
NOT BETWEEN
$select = Db::table ('shop_goods ')->where('id','not between',[6,10])->select();
print_r($select->toArray());
# IN
$select = Db::table('shop_goods')->where('id','in','4 ,7, 10')->select();
print_r($select->toArray());
# がありません
$select = Db::table('shop_goods')->where('id','not in',[4,7,10])->select();
print_r($select->toArray());
# は完全なものでなければなりませんデータベース名
$select = Db::table('shop_goods')->where('id','10')->select();
print_r($select -> ;toArray());
# データベースはプレフィックスを設定しません
$select = Db::name('shop_goods')->where('id',' 11')-> ;select();
print_r($select->toArray());
# データベース設定プレフィックス、プレフィックス アクセスなし
$select = Db::name ('list')->where('id','12')->select();
print_r($select->toArray());
2. データベース プレフィックス
->field( 'title,price,discount as d') ->where('status',1) -> ;select();print_r($select ->toArray()); Array
$select = Db: :table('shop_goods')
- & gt; フィールド ([# タイトル ', ' 価格 ', ' 割引 '= & GT # 追加、追加できるのはこれらのフィールドのみです
## 複数のフィールド$data = [ 'タイトル' = > '新商品', '価格' => 50, '割引' => 8,
'add_time' => 1576080000
];
$insert = Db::table('shop_goods')
other; field( 'add_time')
-&gt; insert($ data);
#print_r($ insert);
#クエリすべてのフィールド、より高速
$ select = db :: table( 'shop_goods')
( '*')
。);
2,
withoutFieldwithoutField メソッドは、データ テーブルのフィールドを除外するために使用されます
Db::table('shop_goods')->withoutField('id')->select();
3、
fieldRaw