选择找到的行 mysql php 代码 [英] select found rows mysql php code
问题描述
我刚刚在堆栈上找到了这个 获取单个值来自 Mysql/PHP 的单行:
I just found this on stack Getting single value from a single row with Mysql/PHP:
$result = end(mysql_fetch_array(mysql_query('SELECT FOUND_ROWS()', $db)));
我在谷歌上搜索并找不到易于理解的描述.
I searched and could not find an easy to understand description on google.
有人可以解释一下 select found_rows() 吗?
Could somebody please explain select found_rows()?
$db 可能是什么样子?
What would $db possibly look like?
这会返回一行的特定值还是像 select * 这样的整行?
Does this return a particular value of a row or the entire row like select *?
推荐答案
$db
是 MySQL 连接句柄.FOUND_ROWS()
返回在查询没有 LIMIT
子句时本应返回的总行数,而无需重新运行查询.
$db
is a MySQL connection handle. FOUND_ROWS()
returns the total number of rows that would have been returned if the query didn't have a LIMIT
clause, without re-running the query.
这篇关于选择找到的行 mysql php 代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!