I am trying to use custom session handlers to store session data in a MySQL database. However, I continue to receive the following warning:
mysql_close(): supplied argument is not a valid MySQL-Link resource
Here is the code I use that I got from here :
function _open(){
global $_sess_db;
$_sess_db = mysql_connect("localhost", "root", "******");
if ($_sess_db) {
return mysql_select_db('style', $_sess_db);
}
return false;
}
function _close(){
global $_sess_db;
return mysql_close($_sess_db);
}
The full text of the error message ultimately points to the final "return mysql_close ($ _ sess_db);" line. I can confirm that the mysql_connect information really works, and I also have the rest of the session handler functions.
And in case this helps, I immediately get these errors when loading the page, without actually calling any functions of the session handler and not opening any current sessions.