RE: [PHP-DB] Oracle connection problem after call to unserialize( )
| From: | Ford, Mike [LSS] | Date: | Tue, 24 Sep 2002 12:22:14 +0000 |
| Subject: | RE: [PHP-DB] Oracle connection problem after call to unserialize( ) | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-21960@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Valantis Kamayiannis [mailto:kamayiannis@logismos.gr]
> Sent: 24 September 2002 12:37
>
> I made a class called OracleCon that is used to connect to an
> Oracle server
> and provide some certain queries to the database
> When i create an object of that class and serialize it to add it to a
> cookie, if i echo the $object->connection attribute i get a
> "Resource id #2"
>
> When after redirection due to succefull login, i need to use
> this object to
> run the queries i get an error like this:
>
> Warning: ociparse(): supplied argument is not a valid OCI8-Connection
> resource in c:\program files\apache
> group\apache\htdocs\php\OracleCon.inc on
> line 66
>
> What is wrong with this?
You can't carry a connection resource from one page to another -- you have
to script an OCILogon (or OCIPLogon) in every page that needs to access your
database. (This is true not just for Oracle -- all the databases supported
in PHP that I've looked at work the same way.)
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211