RE: [PHP-DB] Oracle connection problem after call to unserialize()

2002-09-24 Thread Ford, Mike [LSS]

 -Original Message-
 From: Valantis Kamayiannis [mailto:[EMAIL PROTECTED]]
 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: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP-DB] Oracle connection problem after call to unserialize()

2002-09-24 Thread Miguel Carvalho

 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.

Miguel





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




Re: [PHP-DB] Oracle connection

2001-03-12 Thread Doug Schasteen

can odbc be used from php on linux, or is it just a windows thing?


- Original Message -
From: "Andrew Hill" [EMAIL PROTECTED]
To: "Joe Brown" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, March 12, 2001 5:32 PM
Subject: Re: [PHP-DB] Oracle connection


 Or, you can use ODBC :)

 A PHP/ODBC HOWTO is available at http://www.iodbc.org
 and driver are available at www.openlinksw.com

 Please let me know if you require assistance.

 Best regards,
 Andrew
 ---
 Andrew Hill - OpenLink Software
 Director Technology Evangelism
 eBusiness Infrastructure Technology
 http://www.openlinksw.com


 On 3/12/01 6:22 PM, "Joe Brown" [EMAIL PROTECTED] wrote:

  You need to acquire the oracle network drivers for linux, from Oracle.
I'm
  only aware of the ones that come with Oracle for linux, though they may
have
  them bundled seperately.
 
  Fight your way through the inconcievably difficult installation process.
 
  After defining some environment variables (they can be set after the
fact
  too) which point the the oracle/home;net drivers, compile
php --with-oci8 or
  similar argument.
 
  Start apache server the proper set of environment variables, be sure to
set
  your nls_lang, etc...
 
  Now you should be able to access 'em.
 
  There is a fair amount of work involved, but it seems to be working
nicely
  for me.  A little tenacity will prevail. :-)
 
  Oh, you can put_env(SID=ORCL) etc...  in your php code, instead of
setting
  up environment variables, prior to compile/apache start.  If you have
  mutiple instances, this may be the preferred method.  With a single
  instance, I find it simpler to start apache w/a script that sets the
  variables prior to startup.
 
  Oh yeah, lots of reading is involved too  ;-)
 
  ""Marco Eyzaguirre"" [EMAIL PROTECTED] wrote in message
  002601c0ab42$fac54f40$[EMAIL PROTECTED]">news:002601c0ab42$fac54f40$[EMAIL PROTECTED]...
 
  I got a question:
 
  How can I access an Oracle database located on an Oracle 8i installed
in
  Windows NT from PHP installed on a Linux box?
 
  thanx in advance for you answers
 
  Greetings
 
  Marco Eyzaguirre
  DB Administrator
  Ilender Peru S.A.
  www.ilender.com.pe
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
[EMAIL PROTECTED]
 
 
 


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]