Phpoci8 test and oci8 test. Phpoci8 test, oci8 test Oracle_db.class.php? PhpclassOracle_db {public $ link; publicfunction _ construct () {$ this-link $ this-connect (); if (! $ This-link) {echo connection failure php oci8 test, oci8 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.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1017651.htmlTechArticlephp oci8 test, oci8 test Oracle_db.class.php? Php class Oracle_db {public $ link; public function _ construct () {$ this-link = $ this-connect (); if (! $ This-link) {echo "connection failed "...