PHP 用firebug显示mysql查询日志

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP 用firebug显示mysql查询日志相关的知识,希望对你有一定的参考价值。

if (!function_exists('debug_mysql_query')) {
    
    function debug_mysql_query($query)
    {
        $js_query = str_replace(array('\\', "'"), array("\\\\", "\\'"), $query);
        $js_query = preg_replace('#([\x00-\x1F])#e', '"\x" . sprintf("%02x", ord("\1"))', $js_query);
        echo '<script>console.log("'.$js_query.'");</script>'."\n";
        return mysql_query($query);
    }
}

以上是关于PHP 用firebug显示mysql查询日志的主要内容,如果未能解决你的问题,请参考以下文章