An example of using PhP4 to connect ORACLE data centers

Source: Internet
Author: User

It should be noted that both PhP4 and PhP5 have function numbers that can be connected to the Oracle data volume and query the result set. However, some function numbers can only be used in PhP5, so if the PHP environment is PhP4

First, you must confirm that the function you are using must be supported by PhP4.

<?

$ Orauser = "Scott ";
$ Orapass = "tiger ";
$ Oradb = "(description = (address_list = (address = (Protocol = TCP) (host = 127.0.0.1) (Port = 1521) (CONNECT_DATA = (SID = orcl ))) ";
$ Conn = ocilogon ($ orauser, $ orapass, $ oradb) or die ("ORACLE Server error ");
$ SQL = "select * from EMP ";
$ Stmt = ociparse ($ Conn, $ SQL );
Ociexecute ($ stmt );
While (ocifetch ($ stmt )){
Echo ociresult ($ stmt, 1). '= ';
Echo ociresult ($ stmt, 2). '= ';
Echo ociresult ($ stmt, 3). '= ';
Echo ociresult ($ stmt, 4). '= ';
Echo ociresult ($ stmt, 5). '= ';
Echo ociresult ($ stmt, 6). '= ';
Echo ociresult ($ stmt, 7). '= ';
Echo ociresult ($ stmt, 8 );
Echo "</BR> ";
}
?>

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.