计数记录返回MySQL原则 [英] Count Records Returned MySQL Doctrine

查看:101
本文介绍了计数记录返回MySQL原则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查从我的MySQL数据库
的搜索返回的记录数量,如下所示:

How do I check the number of records returned from a search of my MySQL database with a statement like this:

$searchKey = 'Something to search for'; 
$searchResults = Doctrine::getTable('TableName')->createQuery('t')- 
    >where('columnName LIKE ?','%'.$searchKey.'%')->execute(); 


推荐答案

也许

$searchResults->rowCount();

from here

这篇关于计数记录返回MySQL原则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆