govtcheeze Posted January 5, 2007 Share Posted January 5, 2007 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 More sharing options...
michaellunsford Posted January 6, 2007 Share Posted January 6, 2007 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? Link to comment https://forums.phpfreaks.com/topic/32996-storing-sockets-in-mysql/#findComment-153901 Share on other sites More sharing options...
trq Posted January 6, 2007 Share Posted January 6, 2007 Resources are kill ed of by the garbage collection. They cannot be saved / stored. Link to comment https://forums.phpfreaks.com/topic/32996-storing-sockets-in-mysql/#findComment-153913 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.