How PHP connects to Oracle and takes out data

Source: Internet
Author: User
Tags phpinfo php
My environment, APACHE2.2 php5.2.17 Win2003 has a database of Oracle 9i installed

1, how to connect, I php.ini inside removed Extension=php_oci8.dll, but in phpinfo inside still can't see OCI8 extension, looked for said to download a instantclient-basic-nt-11.2.0.3.0 It is then added to the system variable. I tried, or I couldn't, I was connected.
$link =oci_connect (' user ', ' pass ', ' instance ') or Die (' Connection failed '); Oci_connect (user, password, instance name) don't know that?

Page tip Fatal error:call to undefined function oci_connect ()



2, if connected to Oracle, how to get the result set. There's no such thing as an orc in the PHP manual.
General MySQL fetch data is generally used Mysql_fetch_assow (mysql_query (' SELECT * from Number ') to take this, the corresponding Oracle should also have such a function.


Reply to discussion (solution)

You may need to install an Oracle 9 client, and your installation disk will have
Oracle 8 and previously do not need to install the client
Oracle 10 and later be sure to install the client

You may need to install an Oracle 9 client, and your installation disk will have
Oracle 8 and previously do not need to install the client
Oracle 10 and later be sure to install the client

There is already a client installed, but I still can't see the extension, thank you

Are you modifying the php.ini of the Loaded Configuration File in Phpinfo php.ini?

2. Is there a oci_fetch_array/oci_fetch_assoc/oci_fetch_row?

2. Is there a oci_fetch_array/oci_fetch_assoc/oci_fetch_row?

Yes, I was modified under the Windows PHP.ini, but the second line does not know what meaning, my d disk does not d:\php-sdk\snap_5_2\vc6\x86\template this file, whether it is related to this file?

I do not know, anyway I will extension=php_oci8.dll in front of the fly semicolon to remove it.
Oddly enough, you loaded the Configuration File as empty.

  • 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.