有没有办法在typo3版本10中执行纯SQL?我怎样才能做到这一点?
// in previous versions you could do the following
$sql = 'SELECT * FROM tt_content;';
$GLOBALS['TYPO3_DB']->sql_query($sql);
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
// ...
}
Run Code Online (Sandbox Code Playgroud)
编辑
简单的脚本SELECT * FROM tt_content只是一个占位符。我想对我的统计页面进行一些特殊的迁移或一些特殊的请求。
小智 5
$connection = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('tt_content');
$resultSet = $connection->query('SELECT * FROM tt_content')->execute();
Run Code Online (Sandbox Code Playgroud)