Try the oci8 extension in PHP, try the phpoci8 extension _php tutorial

Source: Internet
Author: User

Try the oci8 extension in PHP and try the phpoci8 extension


Let's share a PHP operation class for Oracle

Oracle_db.class.php

<?phpclass oracle_db{public $link;    Public Function __construct () {$this->link= $this->connect ();      if (! $this->link) {echo "Connection failed";    Exit  }} public Function connect () {return Oci_connect (' demo ', ' demo ', ' Localhost/xe ', ' Al32utf8 ');    The Public function execute ($sql) {$result =false;    $stid =oci_parse ($this->link, $sql);    if ($stid) {$result =oci_execute ($stid);  } return Array ($stid, $result);  Public Function Fetch_assoc ($stid) {return Oci_fetch_assoc ($stid);    The Public Function Fetch_one ($stid) {$arr = $this->fetch_assoc ($stid);    $this->free ($stid);  return $arr;    Public Function Fetch_all ($stid) {$arr =array ();    while ($row = $this->fetch_assoc ($stid)) {$arr []= $row;    } $this->free ($stid);  return $arr;  Public Function Num_rows ($stmt) {return oci_num_rows ($stmt);  Public Function error () {return oci_error ($this->link); The Public Function free ($stid) {return oci_free_statement ($stID);  } public Function Server_version () {return oci_server_version ($this->link);  } public Function Client_version () {return oci_client_version ();  } public Function __destruct () {return oci_close ($this->link); }  //}

The above is the whole content of this article, I hope you can enjoy

http://www.bkjia.com/PHPjc/1019076.html www.bkjia.com true http://www.bkjia.com/PHPjc/1019076.html techarticle try php oci8 extension, trial phpoci8 extension to share a PHP operation Oracle operations class Oracle_db.class.php Phpclass oracle_db{public $link; function __construct () {$thi ...

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