Home > Article > Backend Development > thinkphp 3.1.2 About the method of printing sql statement
<code> M('user')->where('user_id = %d', $v['user_id'])->find()</code>
Excuse me, there is such a data query method in thinkphp3.1.2. How to print out the native sql statement it executes?
<code> M('user')->where('user_id = %d', $v['user_id'])->find()</code>
Excuse me, there is such a data query method in thinkphp3.1.2. How to print out the native sql statement it executes?
I read the wrong question
<code>echo M("user")->getLastSql();</code>
M('user')->fetchsql(true)->where('user_id = %d', $v['user_id'])->find()