View Single Post
Old 13th July 2007, 15:03
Mosquito Mosquito is offline
Join Date: Nov 2006
Posts: 85
Thanks: 5
Thanked 6 Times in 5 Posts
Default Storing Session Data in MySQL Table

Hello all,

I am having an odd problem that I was hoping you could help with. I have a PHP application that stores session data into a MySQL table. This process works fine on Windows Server 2003. I am now migrating this application to a linux server. Since the migration, it fails to work at all.

I continue to receive this message in my error logs:
PHP Fatal error:  Call to a member function query() on a non-object in /path/to/file/file.php on line 83
Line 83 looks like this (in Write_Session):
$result = $connection->query("SELECT session_id FROM $session_table WHERE session_id = '$sess_id'");
Now, normally, I would assume that their is a problem with the connection object. However, it is set globally and is used just fine in my Read_Session function:
$result = $connection->query("SELECT * FROM $session_table WHERE session_id = '$sess_id'");
I have compared the php.ini files of the Windows machine and the linux machine. Aside from the obvious linux/windows differences, all of my paths, variables, etc. are set correctly.

I am using (in case this helps)
PHP 5.2.2 (cli) (built: May  8 2007 08:15:05)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
Does anyone have any ideas?
Reply With Quote
Sponsored Links