使用 INTO OUTFILE 查询获取返回的行数?
我想要获取使用 INTO OUTFILE 查询时返回的行数。
然而,使用mysql_num_rows()
会产生错误&我不想使用任何会导致数据存储在数据集中的内容,例如 COUNT()。有办法做到这一点吗?
I am wanting to get the amount of rows returned when using a INTO OUTFILE
query.
However, using mysql_num_rows()
produces an error & I don't want to use anything that will result in the data being stored in the dataset such as COUNT(). Is there anyway to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您在运行 SELECT ... INTO OUTFILE 后运行
,您应该会得到返回的行数。
MySQL 文档(
如果您正在这样做)在 php 中,有
mysql_num_rows()
命令包装了此功能。If you run
after you run the
SELECT ... INTO OUTFILE
you should get the number of rows returned.MySQL Documentation
if you're doing this in php there's the
mysql_num_rows()
command that wraps this functionality.我无法评论上面的(found_rows)响应,但我想(对于任何可能来到这里的人)这在复制安装中不可靠:
来自 mysql 文档:
重要
FOUND_ROWS() 无法可靠地复制,并且不应与要复制的数据库一起使用。
https://dev.mysql.com/doc /refman/5.0/en/information-functions.html#function_found-rows
我认为这个限制很重要
Saludos
I cannot comment the above (found_rows) response, but I wanted to (for anyone that could come here) that this is not reliable in replication installations:
From mysql doc:
Important
FOUND_ROWS() is not replicated reliably, and should not be used with databases that are to be replicated.
https://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_found-rows
I think this limitation is important
Saludos