Re: Connecting PHP to Oracle9i
| From: | Vaughn, Paul | Date: | Thu, 15 May 2003 15:47:34 +0000 |
| Subject: | Re: Connecting PHP to Oracle9i | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-27777@lists.php.net to get a copy of this message | ||
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!";
}
}