RE: Connecting PHP to Oracle9i

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Title: RE: Connecting PHP to Oracle9i

Sorry, I should have posted two messages.  This example was for connecting to Oracle.

My issue seems to have been not including the connection ($conn) with the ociparse statement.  I was not accustom to that with MySql.

$result = mysql_query("select * from users");

vs.

$sql = ("select * from dw_val.process_user"); 
$query = OCIParse ($conn, $sql);

Now I'm am connected and returning results from my query.  For future reference, is this just a difference in coding style, or mysql and oci functions?

Thanks for responding.

 - paul

-----Original Message-----
From: Maxim Maletsky [mailto:maxim@php.net]
Sent: Thursday, May 15, 2003 12:57 PM
To: Vaughn, Paul
Cc: 'php-db@lists.php.net'
Subject: Re: Connecting PHP to Oracle9i



On Thu, 15 May 2003 10:47:34 -0500
"Vaughn, Paul" <Paul.Vaughn@amhealthways.com> wrote:

> This is what I am using to get connected to 8i 8.1.7.4.0.  The $db section
> is copied right out of the TNSNAMES.ORA file, once Oracle Client has been
> installed and setup on the local machine.

> Now that I am connected, I'm having a hard time getting my query to return
> using OCIPARSE().  I am getting "Wrong parameter count for ociparse()".
> Anyone have any ideas on this?

> Thanks for any help. - Paul

> function db_connect()
> {
> $username = "dw_val";
> $password = "dw_val";
> $db="(DESCRIPTION=
>           (ADDRESS_LIST=
>             (ADDRESS=(PROTOCOL=TCP)
>               (HOST = **name or i.p. address**)(PORT=1521)
>             )
>           )
>           (CONNECT_DATA=(SERVICE_NAME=**FQDN**))
>      )";
> $conn = OCILogon($username,$password,$db);
> if (!$conn)
> {
>    echo "Connection failed";
>    echo "Error Message: [" . OCIError($conn) . "]";
>    exit;
> }
> else
> {
>   echo "Connected!";
> }
> }


where is the OCIParse() call at all?

--
Maxim Maletsky
maxim@php.net

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

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux