Extbase - get created sql from query

后端 未结 8 1887
感动是毒
感动是毒 2020-12-01 21:35

i want to get some database tables from my typo3 extensions. The Extension is based on extbase.

The query always returns nothing but the data exists

I\'ve tr

相关标签:
8条回答
  • 2020-12-01 22:39

    I just extended the above snippet, with a $_GET condition. for debugging, just append "?dbg_table=tx_some_of_my_tables" to your address, and you're ready to go ;-)

    if (in_array($_GET['dbg_table'], $sql['tables'])) {
            echo('<div style="background: #ebebeb; border: 1px solid #999; margin-bottom: 20px; padding: 10px;"><pre style="white-space: normal">'.$statement.'</pre></div>');
        }
    
    0 讨论(0)
  • 2020-12-01 22:40

    An easy way without changing any Typo3 core code and not mentioned in any forum so far is using the php "serialize()" method:

    $result = $query->execute();
    echo (serialize($result));
    

    In the result object you find the SQL query ("statement;" ...)

    0 讨论(0)
提交回复
热议问题