![]() |
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: Code:
PHP Fatal error: Call to a member function query() on a non-object in /path/to/file/file.php on line 83Code:
$result = $connection->query("SELECT session_id FROM $session_table WHERE session_id = '$sess_id'");Code:
$result = $connection->query("SELECT * FROM $session_table WHERE session_id = '$sess_id'");I am using (in case this helps) Code:
PHP 5.2.2 (cli) (built: May 8 2007 08:15:05) |
Global?
Is $connection a global variable?
|
Yes it is and used fine in another function
|
How did you initialize $connection?
Is the include_path the same in php.ini on your windows and Linux system? |
Quote:
Code:
WindowsTo initialize, the connection is declared as global. In the begin_session function, the connection is set up. This connection works fine if I am just trying to read the session data, but if I try to write to the session table, the query function is unknown. This is the Begin_Session function: Code:
// GlobalsCode:
function Read_Session($sess_id)Code:
function Write_Session($sess_id, $add_to_session) |
| All times are GMT +2. The time now is 06:26. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.