PHP ActiveRecord上次查询未填写?

PHP ActiveRecord上次查询未填写?,php,activerecord,phpactiverecord,Php,Activerecord,Phpactiverecord,我上面有以下代码。发生的情况是,我正在尝试打印查询,以便查看查询是否正确。查询运行正常,但命令self::connection->last\u query打印以下内容: $remote_ip = $_SERVER["REMOTE_ADDR"]; $today_date = $todaydate->format("Y-m-d H:i:s"); $tomorrow_date = $tomorrowdate->format("Y-m-d H:i:s");

我上面有以下代码。发生的情况是,我正在尝试打印查询,以便查看查询是否正确。查询运行正常,但命令self::connection->last\u query打印以下内容:

$remote_ip = $_SERVER["REMOTE_ADDR"];
        $today_date = $todaydate->format("Y-m-d H:i:s");
        $tomorrow_date = $tomorrowdate->format("Y-m-d H:i:s");

        $conditions['conditions'] = array('ipaddress = ? AND dateattempt > ? AND dateattempt < ?', $remote_ip, $today_date, $tomorrow_date);

        $attempts = self::all($conditions);
        //$attempts = self :: all(array('conditions' => array('ipaddress = ?',$_SERVER["REMOVE_ADDR"])));

/*          print_r($_SERVER); */
/*          print_r($today_date); */
/*          print_r($tomorrow_date); */

        echo self::connection()->last_query;
问题是它是否应该填充?有条件但不是。如何让它显示填写了?的结果?

最后一个查询是原始SQL。PHP ActiveRecord正在使用,因此您不会看到实际的查询

您应该使用记录器。这些值将显示在那里


示例来源:

我将尝试一下,并报告我的任何问题。谢谢
SELECT * FROM `table_name` WHERE ipaddress = ? AND dateattempt > ? AND dateattempt < ?
$log = Log::singleton('file', 'my.log'); //using PEAR Log
ActiveRecord\Config::instance()->set_logging(true);
ActiveRecord\Config::instance()->set_logger($log);