(沒有版本資訊,可能只在 Git 中)
TableSelect::where — 設定選擇搜尋條件
where_expr定義用於篩選文件或記錄的搜尋條件。
一個 TableSelect 物件。
範例 #1 mysql_xdevapi\TableSelect::where() 範例
<?php
$session = mysql_xdevapi\getSession("mysqlx://user:password@localhost");
$schema = $session->getSchema("addressbook");
$table = $schema->getTable("names");
$result = $table->select('name','age')
->where('name like :name and age > :age')
->bind(['name' => 'John', 'age' => 42])
->execute();
$row = $result->fetchAll();
print_r($row);
?>以上範例的輸出結果類似如下:
Array
(
[0] => Array
(
[name] => John
[age] => 42
)
)