Re: is there any reasone why the following doesn't work?

From: Date: Fri, 26 Dec 2008 02:18:41 +0000
Subject: Re: is there any reasone why the following doesn't work?
Groups: php.db 
Request: Send a blank email to php-db+get-45832@lists.php.net to get a copy of this message
--- On Thu, 12/25/08, Fred Silsbee <fredsilsbee@yahoo.com> wrote: > From: Fred Silsbee <fredsilsbee@yahoo.com> > Subject: is there any reasone why the following doesn't work? > To: php-db@lists.php.net > Date: Thursday, December 25, 2008, 11:57 PM > $connection=oci_connect('landon', > 'xxxxxxx',$db) > session_start(); > $_SESSION['connection'] = $connection; > . > . > . > > $connection = $_SESSION['connection'] ; shows > nothing! > > My program allows many operations on a table re-entering at > the top > and deciding what option to do next. > > I don't want to keep logging into Oracle but use the > previous connection _____________________________________ answer? when the php code exits, it must detach the connection and even zero the variable $connection in the _SESSION. Problem is that my complete program never exits! What constitutes an "exit" Running this over and over the $connection is not remembered! <?php session_start(); $connection = $_SESSION['connection'] ; $conn = $_SESSION['conn'] ; print($conn); $db = "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = LMKIIIGDNSID) ) )"; if(!$connection) { echo "OOOPS! NO connection, better make one ................."; if ($connection=oci_connect('landon', 'xxxxx',$db)) { echo "Successfully connected to Oracle.\n"; $_SESSION['connection'] = $connection; } else { $err = OCIError(); echo "Oracle Connect Error " . $err['message']; } } else { print ("conn0 = ".$connection." "); } print ("conn0 = ".$connection." "); $conn = 5.6; $_SESSION['conn']= $conn; //this doesn't perish ?>

« previous php.db (#45832) next »