[thelist] PHP/Oracle Command line Segmentation Fault

Christopher Ditty cditty at mlgw.org
Fri Jan 10 08:33:01 CST 2003


I posted this on the PHP list yesturday, but no one has answered yet.
Hopefully, someone here can help.

I have successfully installed oracle 8.1.7 w/ php and have it
configured
to run from the command line.  When I run a simple script that
connects,
and selects records from the database, the last line is a segmentation
fault error.  This does not seem to happen when the same script is run
through the browser.

Can anyone offer any help or advice?  The code is listed below.

CDitty

#!/usr/bin/php
<?
function oci8Connect(){
         $db_conn = ocilogon("usrname","pwd", "dbase");
         if (!$db_conn){
         	echo "Help<br>";
            exit ();
         }
         echo "Connected<br>";
         return ($db_conn);
}

$conn = oci8Connect();

$stmt = ociparse($conn,"select * from US_MSTR");
  ociexecute($stmt);

	$i=0;
	$row = array();

  while(OCIFetchInto($stmt, &$row, OCI_ASSOC)){
 		# do stuff with $row...
 		echo $row['US_ID'] . " $i<br>";
 		$i++;
	}

	ocifreestatement($stmt);
	ocilogoff($conn);
?>




More information about the thelist mailing list