connection from one page to another

This is a discussion on connection from one page to another within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi I have a class that is my interface to mysql. I create an instance og class an connect to ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-05-2005
gachsaran
 
Posts: n/a
Default connection from one page to another

Hi

I have a class that is my interface to mysql. I create an instance og
class an connect to db. Then i change to another page and want to use
the same instace of class. How can i send an object (the instance) to
another page ?


Any help will be appricated.
Gachsaran
Reply With Quote
  #2 (permalink)  
Old 12-09-2005
Colin McKinnon
 
Posts: n/a
Default Re: connection from one page to another

gachsaran wrote:

> Hi
>
> I have a class that is my interface to mysql. I create an instance og
> class an connect to db. Then i change to another page and want to use
> the same instace of class. How can i send an object (the instance) to
> another page ?
>


Serialize it then pass it as you would any other variable. The receiving
script needs to include the class definition before you deserialize it (but
PHP5 can try automatically include a class file for an undefined class).

Actually you can get by without serializing it and passing it via the
seesion, but you can get strange complications doing this.

The resource cannot be passed out of the thread in which it was created -
see the sleep and wakeup functions.

C.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:17 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0