Connecting Oracle for NT remote database with PHP _php tutorial

Source: Internet
Author: User
I used to connect with PHP remote oracle8.0.5 for NT Enterprise Edition, with Odbc,oracle interface is not. I'm not too shy! Search, finally found the right way to connect, I use the OCI interface here, ODBC and Oracle or not to find%m epiphyseal? 嶣 5 pouring 饩 Margaret Pennant Ās Xing Huan? OCI foot already, foot already!
The source code is as follows:
$dbconn =ocilogon ("ZYPDP", "ZYPDP", "(Description= (address= (PROTOCOL =tcp) (host=10.65.73.3) (PORT = 1521)) (connect_ DATA = (SID=ORCL)));
if ($dbconn!=false)
{
echo "Connected successfully";
if (Ocilogoff ($dbconn) ==true)
{
echo "Close connection succeeded!"; /=, there's a problem here.
}
}
Else
{
echo "Connection Failed";
}
?>
-----------------Explain------------------------------
-----1. -PHP4 Reference Manual: (Rotten Things)
Ocilogon
Open a link to Oracle.
Syntax: int Ocilogon (string username, string password, string [Ocacle_sid]);
return value: Integer
Function Type: Database function
Content Description
This function enables PHP to connect with Oracle. The parameters username and password are the connection account number and password respectively. The parameter ocacle_sid is the database name, which can be omitted. The return value is the concatenated code.
---2. My explanation:
Username, password do not need me to say, I want to say ocacle_sid should be called Connection identification string, "(Description= (address= (PROTOCOL =tcp) (host=10.65.73.3) (PORT = 1521)) (connect_ DATA = (SID=ORCL)) "
Address:oracle Server address Protocol is a transport protocol, generally with TCP; HOST: server IP address; port: port number, which is the default.
Connect_data: Here is the database name, or the Oracle database start service name, the "service" can find the specific name, as long as your Oracle is the province installed, that is ocrl.
---3. What are you going to do!
(1) Confirm that your PHP configuration is php_oci8.dll dynamic library.
(2) Confirm that the Oracle8i client, or server, is installed.
(3) Locate the IP of your Oracle server and change it to your IP, with the database name
(4) Don't forget, you have to have a user name and password to access the remote database
Everything! Go do it!!!

http://www.bkjia.com/PHPjc/315677.html www.bkjia.com true http://www.bkjia.com/PHPjc/315677.html techarticle I used to connect with PHP remote oracle8.0.5 for NT Enterprise Edition, with Odbc,oracle interface is not. I'm not too shy! Search, finally found the right way to connect, I use the OCI interface here, ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.