FuelPHP 查看 Query SQL

在 FUelPHP 中,想要打印执行过的 SQL 来差错,貌似没有封装好的方法。

可以用框架自带的 Code Profiler 工具

一、相关配置

1、config.php 中,设置 'profiling'    => true

'profiling'  => true,

2、db.php 中,设置 'profiling'    => true

return array(
    'default' => array(
        'connection'  => array(
            'dsn'        => 'sqlsrv:Server=localhost,1433;Database=DEMO;',
            'username'   => 'sa',
            'password'   => 'xxxxxx',
        ),
    'identifier' => '', // 空白を指定
    'charset'   => '', // 空白を指定
    'profiling'    => true 
    ),
);

二、查看

页面右下角打开 profiler,在 Queries 中查看所有执行的 SQL

原文地址:https://www.cnblogs.com/rendd/p/12170496.html