MySQL资源ID [英] MySQL Resource id #

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

问题描述

我从远程服务器请求密码,将其存储在数据库表中,然后将其恢复以用于多个URL请求,并且能够检索xml数据,然后将其显示在页面上.

I request a password from a remote server, store in a database table and recover it for use in several URL requests, and am able to retrieve xml data which I can then display on my pages.

这似乎很好用,除了除了xml数据外,该代码似乎还输出如下所示的字符串:

This seems to work fine, except in addition to the xml data, the code also seems to output strings that looks like this:

Resource id #[random number]

有人知道这可能是由于什么造成的吗?

Does anyone know what this might be due to?

我从数据库恢复密码的代码如下:

My code to recover the password from the db looks like this:

$result = mysql_query("SELECT * FROM db_table WHERE id=1") 
or die(mysql_error());  

$row = mysql_fetch_array($result);
$my_info =  $row['id_string'];

谢谢!

推荐答案

多数民众赞成在php资源的字符串转换,例如您的数据库句柄,数据库查询结果或文件句柄(从fopen撤消).在某处您正在做类似

Thats a string conversion of a php resource like your db handle, result from a db query, or a file handle (retunred from fopen). Somewhere you are doing something like

echo $result;

相对于

echo $my_info;

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

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