'How to save php socket resource in database?

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 ?

Thanks !



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pascal MARTIN