473,288 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 software developers and data experts.

Array of Objects in session, is it possible to access member functions?

I am trying to pass an array of user objects in session and take the
array out of session and call the member functions of each object.
However I am getting a Fatal error: Call to a member function on a
non-object. I have session.autostart turned off, and I have the
class definition for those objects included before the call to
session_start(). I am on PHP 4.2.3. Is this possible to do? While
debugging, it appears that the objects in the array are only seen as a
type of standard "object", and that I can only access the member
variables of the object. I tried casting to the user defined class,
but this does not see to work. Is there a way to pull these objects
out of an array that was in the session, and call the member functions
of these objects?
Jul 17 '05 #1
2 2005
co**********@yahoo.com (college) emerged reluctantly from the
curtain and staggered drunkenly up to the mic. In a cracked and
slurred voice he muttered:
Is there a way to pull these objects
out of an array that was in the session, and call the member
functions of these objects?


Not unless the objects were serialized first.

See http://www.php.net/serialize

--
Phil Roberts | Deedle Doot Doo Dee Dee | http://www.flatnet.net/
This global evolutionist conspiracy of evil athiests can kiss
my ass! Wheres my goddamn cheque??
Jul 17 '05 #2
"college" <co**********@yahoo.com> wrote in message
news:8d**************************@posting.google.c om...
I am trying to pass an array of user objects in session and take the
array out of session and call the member functions of each object.
However I am getting a Fatal error: Call to a member function on a
non-object. I have session.autostart turned off, and I have the
class definition for those objects included before the call to
session_start(). I am on PHP 4.2.3. Is this possible to do? While
debugging, it appears that the objects in the array are only seen as a
type of standard "object", and that I can only access the member
variables of the object. I tried casting to the user defined class,
but this does not see to work. Is there a way to pull these objects
out of an array that was in the session, and call the member functions
of these objects?


yes but, the class of the object in the question should also be defined in
the code that is executing the function call.

--
http://www.templatetamer.com/
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Corno | last post by:
Hi all, There's probably a good reason why a const object can call non const functions of the objects where it's member pointers point to. I just don't see it. For me, that makes the the const...
2
by: Patrick | last post by:
Hi I have a problem in my C++ Funktion. I needed an 2 dimensional Array. For this i took a template script in order to create the array in the funktion. The Size of the Array I have to calculate...
6
by: surrealtrauma | last post by:
i have a trouble about that: i want to ask user to enter the employee data (employee no., name, worked hour, etc.), but i dont know how to sort the data related to a particular employee as a...
21
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each...
272
by: Peter Olcott | last post by:
http://groups.google.com/group/comp.lang.c++/msg/a9092f0f6c9bf13a I think that the operator() member function does not work correctly, does anyone else know how to make a template for making two...
10
by: Raj | last post by:
I need a VB function to return array of collections like Private Type Employee empname as string address as string salary as integer deptno as integer End Type dim employees() as Employee
2
by: StevenChiasson | last post by:
For the record, not a student, just someone attempting to learn C++. Anyway, the problem I'm having right now is the member function detAddress, of object controller. This is more or less, your...
5
by: Immortal Nephi | last post by:
I would like to design an object using class. How can this class contain 10 member functions. Put 10 member functions into member function pointer array. One member function uses switch to call...
152
by: vippstar | last post by:
The subject might be misleading. Regardless, is this code valid: #include <stdio.h> void f(double *p, size_t size) { while(size--) printf("%f\n", *p++); } int main(void) { double array = { {...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.