Home > Backend Development > PHP Tutorial > thinkphp prints the last sql statement_PHP tutorial

thinkphp prints the last sql statement_PHP tutorial

WBOY
Release: 2016-07-13 10:31:15
Original
1505 people have browsed it

thinkphp printing the last sql statement is a very common usage. It is often used in the process of debugging code. Since my memory is not very good, I will make a note here for future use.

The following is recorded through examples

$form=M('user');
$result=$form->where(array('username'=>'www.phpernote.com'))->select();
//下面就是打印这条sql语句的方法
$form->getLastSql();
Copy after login

Articles you may be interested in

  • The last record of judging volist loop in thinkphp template
  • php creates a simple case of your own MVC framework, providing ideas, For reference only
  • PHP gets the first day and last day of the week and month of the specified date
  • How to delete the first and last element of the array in php
  • PHP function to calculate the current week of the year or January
  • Summary of system constants in thinkphp’s Action controller
  • Summary of commonly used system variables in Thinkphp templates
  • PHP records the source of the search engine and the keywords entered in the search

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/764099.htmlTechArticlethinkphp printing the last sql statement is a very common usage and is often used in the process of debugging code. Since my memory is not very good, I will make a note here for future reference. Below...
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