|
-
May 13th, 2004, 04:44 AM
#1
Thread Starter
Fanatic Member
persisting objects
I'm sure the answer to this is use a session but I thought I would check.
I have a class that I want to use in a lot of my pages but would like to instantiate it once and use it reapetedly. Is there any way to do this other than a session variable.
Thanks
-
May 13th, 2004, 10:59 PM
#2
Member
That or serialize() the class, store it in a database, then unserialize() it when you get it back.
Only ways I can think of
-
May 14th, 2004, 02:53 AM
#3
Thread Starter
Fanatic Member
The class in question is a database connection class which would be needed on most pages (information I omitted in the original post).
If I haven't got a current connection to mysql then I can't read to or write to the database.
-
May 14th, 2004, 11:32 AM
#4
PHP has the session-independent database connection pooling I think, it would be more efficient than sessions.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|