wordpress输出当前执行的sql语句

Posted on Posted in wordpress
Tips: 本文创建于2014年5月27日,已超过 2 年,内容或图片可能已经失效!

1、在wp-config.php中增加代码

[code lang="php"]
define('SAVEQUERIES',true);
[/code]

2、在footer.php中添加

[code lang="php"]
<?php
// </body>前增加
global $wpdb;
echo "<pre>";
print_r($wpdb->queries);
echo "</pri>";
?>
[/code]

Leave a Reply

Your email address will not be published. Required fields are marked *

11 − six =