Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use SQL debugging in thinkphp

Shulou Source: shulou.com Published: 2022-06-03 17:46:18 11月13日 Update

Editor to share with you how to use SQL debugging in thinkphp, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Description

In the model operation, in order to better identify errors, we often need to look at the recently used SQL statement. We can use the getLastsql method to output the last executed sql statement.

Example

Echo Demo::getLastSql (); or echo Db::getLastSql ()

Output

SELECT * FROM `demo` is all the contents of this article entitled "how to debug SQL in thinkphp". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Articles content statements output not much most methods more models knowledge examples industry information information channels errors channels references learning help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information vpn Redmi Huawei MySQL