StupidBeauty
Read times:1417Posted at: - no title specified

转载 ThinkPHP find 方法 查询一条数据记录

ThinkPHP中,如果妳只需要使用单条数据或者确信妳只会查询出单条数据的话,可使用模型类的find()方法来进行查询,它最多返回一条数据。

http://www.5idev.com/p-thinkphp_CURD_find.shtml

亮点

find()

ThinkPHP find() 方法是和 select() 用法类似的一个方法,不同之处 find() 查询出来的始终只有一条数据,即系统自动加上了 LIMIT 1 限制。

当确认查询的数据记录只能是一条记录时,建议使用 find() 方法查询,如用户登录账号检测:

Your opinions

Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands