I have a php page that displays a list of results obtained from running a query using variables passed from a Search Form using Post.
I'd like to save the result set to a Session variable so I can later display the same result set and page after a user has added an item to their cart.
However, when I tried this, I get the following error:
Notice: Undefined variable: arr in C:\PHP\pear\DB.php on line 756
Fatal error: Unknown(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition <b>db_mssql</b> of the object you are trying to operate on was loaded before the session was started in C:\PHP\pear\DB.php on line 756
The code I used is:
$conn = db_ifw_connect();
$result = $_SESSION['search_result']; // the debugger tells me that the session variable is a db Object
while ($row = $result->fetchRow(DB_FETCHMODE_ORDERED))
Evidently there are some other things that I need to do besides just setting $result = session variable.
Any idea what I am missing?
Terry