Home > Backend Development > PHP Tutorial > mysql - 怎样记录thinkphp函数生成的数据库查询语句呢?

mysql - 怎样记录thinkphp函数生成的数据库查询语句呢?

WBOY
Release: 2016-06-06 20:10:20
Original
948 people have browsed it

怎样把thinkphp中的数据库操作函数生成的查询语句记录下来?

回复内容:

怎样把thinkphp中的数据库操作函数生成的查询语句记录下来?

很简单,你可以在M()方法的对象里面对curd操作都添加一个记录日志的方法,

$Model->getLastSql();不知道符合你的需求,我就是这样记录sql的

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template