【发布时间】:2017-08-24 12:42:22
【问题描述】:
如何在此查询中使用 SQL 运算符 (https://www.w3schools.com/sql/sql_operators.asp)?就像例如$uidMin = 5; $uidMax = 20; ...
$uid = 10;
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
$queryBuilder->getRestrictions()->removeAll();
$statement = $queryBuilder
->select('uid', 'pid', 'header')
->from('tt_content')
->where(
$queryBuilder->expr()->eq('uid', $uid)
)
->execute();
while ($row = $statement->fetchAll()) {
$this->view->assign('inet', $row);
}
我尝试的是例如 (http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/query-builder.html)。
$uidMin = 5;
$uidMax = 20;
...
$queryBuilder->expr()->between('uid', $uidMin, $uidMax)
...但没有用。
【问题讨论】:
-
between 声明是相当新的学说。你确定你在支持它的版本上运行吗?
-
似乎 between() 还没有集成:'ExpressionBuilder 类参考'中的api.typo3.org/typo3cms/current/html/…
标签: typo3 typo3-extensions typo3-8.x