* @author spidix * @version %I%, %G% * @since 1.0 */ // The following line show you how to add pear API in your include_path // in case you didn't set it in your php.ini // ini_set("include_path",ini_get("include_path").":".$_NR_DOCUMENT_ROOT."/lib/pear"); // include PEAR::DB class include_once('DB.php'); // Define Oracle database connection by using // user: scott // password: tiger // and tnsnames.ora entry: VIPER.EXZILLA.NET ( Please make sure you use same case in tnsnames.ora ) // Please change VIPER.EXZILLA.NET to match your Oracle Connection String in your enviroment. define("NR_DB_CONNECTION",'oci8://scott:tiger@VIPER.EXZILLA.NET'); // Create connection $dbh = DB::connect(NR_DB_CONNECTION); if (DB::isError($dbh)) { print "Database connection failed: "; print $dbh->getMessage(); exit; } $dbh->setErrorHandling(PEAR_ERROR_DIE); // prepare statment $stmt = "SELECT ename,sal FROM emp"; $result=$dbh->query($stmt); $mode = DB_FETCHMODE_ASSOC; while ($row = $result->fetchRow($mode)){ print "
";
	print_r($row);
	print "
"; } // Database disconnect $result->free(); $dbh->disconnect(); ?>