Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: oracle and php3

Re: oracle and php3

From: <bonanos_at_yahoo.com>
Date: Wed, 09 Jun 1999 12:10:32 GMT
Message-ID: <7jlljj$hoh$1@nnrp1.deja.com>


In article <375E44EB.7D90F9A1_at_tfh-wildau.de>,   Frank Rast <frast_at_tfh-wildau.de> wrote:
> I want to use an Oracle Database with a PHP3 Web-Application.
> My problem is that I do not know how to write the connect string
> (TNSNAME).
> The Syntax is Ora_Logon("user_at_tnsname", "password") where user is a
> valid user of the database. If anybody knows the correct syntax of
> tnsname I would be grateful if you answer my Question. My Database is
> running on another machine than the HTTP Server so I think I have to
> qualify the full name of the Database.



$conn = Ora_Logon("scott_at_gpmc_db", "scott");
	if ($conn < 0) {
		echo("Could not connect to Oracle.\n");
	$good="no";
	exit;
	}

$seq_cur = Ora_Open($conn);

	if ($seq_cur < 0) {
		echo("Could not open a cursor.\n");
		Ora_Logoff($conn);
	$good="no";
	exit;
	}

$sql = "select hdi_ucontent.nextval from dual";
	if (Ora_Parse($seq_cur, $sql) < 0) {
		echo("Parse failed!\n");
		Ora_Logoff($conn);
	$good="no";
	exit;
	}

$ncols = Ora_Exec($seq_cur);

$err = Ora_Fetch($seq_cur);
$col = Ora_GetColumn($seq_cur,0);

$fname=$col;
Ora_Close($seq_cur);

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Wed Jun 09 1999 - 07:10:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US