(沒有版本資訊,可能只在 Git 中)
TableSelect::limit — 限制選取的列數
rows
最大記錄或文件數。
一個 TableSelect 物件。
範例 #1 mysql_xdevapi\TableSelect::limit() 範例
<?php
$session = mysql_xdevapi\getSession("mysqlx://user:password@localhost");
$schema = $session->getSchema("addressbook");
$table = $schema->getTable("names");
$result = $table->select('name', 'age')
->limit(1)
->execute();
$row = $result->fetchAll();
print_r($row);
?>
以上範例會輸出類似以下的內容:
Array ( [0] => Array ( [name] => John [age] => 42 ) )