> 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

You cant't serialize a object that uses as a member a "resource"( let's
say an handler ).When PHP end the script, it will close all handler's used( database
connecitons, files, etc ).
You have to store the login information in a session var or in the database.

> If i echo the $object->connection attribute again i get a "0"!!!! If i
> echo the other attributes, they have the same values as they were set
> before serialization of the object

Handler's are not serializable var's.


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to