How PHP connects to ORACLE and retrieves data

Source: Internet
Author: User
How does PHP connect to ORACLE and retrieve data in my environment? APACHE2.2 php5.2.17 win2003 has installed the oracle 9i database

1. how to connect, My PHP. INI removed extension = php_oci8.dll, but in PHPINFO still can not see the extension of OCI8, looked for said to download a instantclient-basic-nt-11.2.0.3.0 and then added to the system variables. I tried it, but I still cannot.
$ Link = oci_connect ('user', 'pass', 'instance') or die ('connection failed'); // oci_connect (user, password, instance name) don't you know?

The page prompts Fatal error: Call to undefined function oci_connect ()



2. how to obtain the result set if it is connected to ORACLE. It seems that the PHP Manual does not contain ORC instructions.
Generally, mysql uses mysql_fetch_assow (mysql_query ('select * from number') to retrieve data, and the corresponding oracle should also have such a function.


Reply to discussion (solution)

You may need to install the oracle 9 client.
Oracle 8 and earlier client installation not required
Oracle 10 and later must install the client

You may need to install the oracle 9 client.
Oracle 8 and earlier client installation not required
Oracle 10 and later must install the client

You have installed the client, but still cannot see the extension. thank you.

Is the php. ini you modified the php. ini File of the Loaded Configuration File in phpinfo?

2. isn't there any oci_fetch_array/oci_fetch_assoc/oci_fetch_row?

2. isn't there any oci_fetch_array/oci_fetch_assoc/oci_fetch_row?

Yes, I am modifying PHP under WINDOWS. INI, but the second line does not know what it means. my d disk does not have the d: \ php-sdk \ snap_5_2 \ vc6 \ x86 \ template file. is it related to this file?

I don't know. I can just remove the semicolon before extension = php_oci8.dll.
It is strange that your Loaded Configuration File is empty.

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.