当前位置:Gxlcms > 数据库问题 > 打印出最后执行的mysql 语句

打印出最后执行的mysql 语句

时间:2021-07-01 10:21:17 帮助过:4人阅读

 

db.php 文件中添加

public function getlastsql(){
return $this->sql;
}

 

入口文件中添加,公共方法

function getlastsql(){
include ‘../cmstop/framework/factory.php‘;
$db = & factory::db();
return $db->getlastsql();
}

 

function mylog1($input){

$file = ‘../mylog1.txt‘;
file_put_contents($file,‘执行时间:‘.date(‘Y-m-d H:i:s‘,time())."\n".$input."\n\n",FILE_APPEND);

}

 

打印出最后执行的mysql 语句

标签:

人气教程排行