php教程

SDO_DAS_ChangeSummary::beginLogging

(^)

SDO_DAS_ChangeSummary::beginLogging Begin change logging

说明

SDO_DAS_ChangeSummary::beginLogging ( void ) : void
Warning

此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担 。

Begin logging changes made to the SDO_DataObject.

参数

None.

返回值

None.

User Contributed Notes

DAMNBOY 14-Jun-2018 10:05
<?php

/**
 * Created by PhpStorm.
 * User: Kibo
 * Date: 09-06-18
 * Time: 18:48
 */
class Database
{

    protected
$url;
    protected
$user;
    protected
$passw;
    protected
$db;
    protected
$connection = null;

    public function
__construct($url,$user,$passw,$db){
       
$this->url = $url;
       
$this->user = $user;
       
$this->passw = $passw;
       
$this->db = $db;
    }

    public function
__destruct() {
        if (
$this->connection != null) {
           
$this->closeConnection();
        }
    }

    protected function
makeConnection(){
       
//Make a connection
       
$this->connection = new mysqli($this->url,$this->user,$this->passw,$this->db);
        if (
$this->connection->connect_error) {
            echo
"FAIL:" . $this->connection->connect_error;
        }
    }

    protected function
closeConnection() {
       
//Close the DB connection
       
if ($this->connection != null) {
           
$this->connection->close();
           
$this->connection = null;
        }
    }

    protected function
cleanParameters($p) {
       
//prevent SQL injection
       
$result = $this->connection->real_escape_string($p);
        return
$result;
    }

    public function
executeQuery($q){

       
//Is there a DB connection?
       
$this->makeConnection();
       
//check for SQL injection

        //execute query
       
$results = $this->connection->query($q);

        return
$results;

    }

}

CopyRight © 2008-2022 verySource.Com All Rights reserved. 京ICP备17048824号-1 京公网安备:11010502034788