core
db
html
utility
SqlAbstract::orWhereIn
public SqlAbstract orWhereIn
( string $column, array $values )
IN演算子による条件をOR結合で指定します。
whereInのOR版です。
$ages = array(20, 21, 22, 23, 24, 25);
$select->where('name', 'taro');
$select->orWhereIn('age', $ages);
→WHERE (name = 'taro') OR (age IN (20, 21, 22, 23, 24, 25))
orWhereメソッドと同様、最初の一つ目の条件指定時はwhereInと違いはありません。
whereInのOR版です。
$ages = array(20, 21, 22, 23, 24, 25);
$select->where('name', 'taro');
$select->orWhereIn('age', $ages);
→WHERE (name = 'taro') OR (age IN (20, 21, 22, 23, 24, 25))
orWhereメソッドと同様、最初の一つ目の条件指定時はwhereInと違いはありません。
パラメーター
| 名前 | 型 | 内容 |
|---|---|---|
| $column | string | 条件比較対象の列名を指定します。 |
| $values | array | 第一引数で指定した列に対する複数の値を配列で指定します。 |
返り値
自分自身のインスタンスを返します。