PHP oci8 Small test, oci8 _php tutorial

Source: Internet
Author: User

PHP oci8 Small test, oci8 small test


Oracle_db.class.php

Class 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 ');
}
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);
}

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);
}
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);
}
//
}

http://www.bkjia.com/PHPjc/1017651.html www.bkjia.com true http://www.bkjia.com/PHPjc/1017651.html techarticle php oci8 Small test, oci8 small test Oracle_db.class.php? PHP class oracle_db{public $link; public Function __construct () {$this-link=$ This-connect (); if (! $this-link) {echo "Connection failed" ...

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