没有查询到结果found_row()=1?急!求帮忙!!!!

freewyy 2014-03-13 12:05:55
请问各位大神们,为什么会有这样的结果?如果我想知道是否查到结果了,除了count(*)意外还有什么办法,因为不想那么复杂的查询,一个返回结果集,一个返回count(*)。
...全文
63 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
freewyy 2014-03-13
  • 打赏
  • 举报
回复
引用 2 楼 WWWWA 的回复:
你是在MYSQL命令行下运行还是图形化管理工具中运行?
后台调用found_row()的结果作为输出参数,判断是否查询到
WWWWA 2014-03-13
  • 打赏
  • 举报
回复
你是在MYSQL命令行下运行还是图形化管理工具中运行?
benluobo 2014-03-13
  • 打赏
  • 举报
回复
For a SELECT with a LIMIT clause, the number of rows that would be returned were there no LIMIT clause A SELECT statement may include a LIMIT clause to restrict the number of rows the server returns to the client. In some cases, it is desirable to know how many rows the statement would have returned without the LIMIT, but without running the statement again. To obtain this row count, include a SQL_CALC_FOUND_ROWS option in the SELECT statement, and then invoke FOUND_ROWS() afterward:

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧