Jump to content

storing sockets in mySQL


govtcheeze

Recommended Posts

Is it possible to store socket data into a mySQL table? I have tried many different ways, using blobs and text and my INSERT never populates properly.

I tried looking for the datatype of a socket resource but found no results either, so I am stumped. Is this possible and if so how?

I basically want a way to track all sockets connected, and attach stuff like username, time connected, etc to the record via a table. This will also allow me to access the users from functions outside the main script, which is why using a session variable will not work.

Edit: just to clarify, I want to INSERT $client (which is the results of $client = socket_accept($master);) and then perform an UPDATE with username, etc as the information is parsed / becomes available.
Link to comment
https://forums.phpfreaks.com/topic/32996-storing-sockets-in-mysql/
Share on other sites

maybe I'm confused, but I'm thinking a socket is a connection to something. So a connection isn't really data you can record.

Are you wanting to store the data used to create the socket to recreate it without having to retype all the data?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.