我试图从我的两个链接表中输出一些数据并查看我能找到的所有示例,但我仍然没有得到任何结果。 (注意:我在任一个表上尝试过exec_SELECTquery,它就像魅力一样)
所以这是我的代码
$GLOBALS['TYPO3_DB']->debugOutput = true;
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
'tx_pagecat_category.title', // $select_fields
'tx_pagecat_category', // $local_table
'pages_tx_pagecat_category_mm', // $mm_table
'pages', // $foreign_table
'', //$where_clause
'', // $groupBy
'', // $orderBy
'' // $limit
);
while( $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res) ) {
$c= $row['tx_pagecat_category.title'].chr(10);
}
return $this->pi_wrapInBaseClass($c);
我完全不知道我做错了什么,即使Debug-Output无法正常工作?
答案 0 :(得分:0)
可能最简单的方法是:
$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = 1;
// query here
echo $GLOBALS['TYPO3_DB']->debug_lastBuiltQuery;
这将为您提供发送到db的sql。然后,您可以手动运行该查询以检查错误。