如何在数据库中保存PHP套接字资源? [英] How to save php socket resource in database?

查看:33
本文介绍了如何在数据库中保存PHP套接字资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用socket_create在php中创建一个套接字,并希望将接收到的套接字存储在数据库中(以从其他php代码访问).但是,套接字的类型为资源".如何将其存储在mysql中?

I am creating a socket in php with socket_create and would like to store the received socket in a database (to access from other php code). However the socket is of type 'resource'. How can I store this in mysql ?

谢谢!

推荐答案

您无法在数据库中存储资源/套接字.

You cannot store a resource / socket in database.

相反,您必须存储允许您在必要时重新创建的信息.

Instead, you'd have to store the informations that would allow you to re-create it when necessary.

这篇关于如何在数据库中保存PHP套接字资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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