mysql_query给出资源ID#17 [英] mysql_query gives Resource id #17

查看:69
本文介绍了mysql_query给出资源ID#17的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个表需要写入结果,稍后会更新。要检查表是否已写入但我正在使用此代码:

展开 | 选择 | Wrap | 行号

解决方案

从手册

展开 | 选择 | Wrap | 行号


不是真的。它正在返回一个关于成功的Rescource,但正如我所提到的那样,它在sql中得到了空集(我想要的),所以肯定它应该返回false?

我错过了什么?

是的,空结果集不是错误。

要检查空结果集,请使用mysql_num_rows()


Have a table that needs to have results written to it, that will later be updated. To check if the table has been written to yet I''m using this code:

Expand|Select|Wrap|Line Numbers

解决方案

From the manual

Expand|Select|Wrap|Line Numbers


Not really. It''s returning a Rescource on sucess but as I mentioned it was getting Empty Set (which I wanted) in the sql so surely it should be returning false?
Am I missing something?


Yes, an empty result set is not an error.
To check for an empty result set use mysql_num_rows()


这篇关于mysql_query给出资源ID#17的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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