Try the oci8 extension in php and the phpoci8 extension. Try the oci8 extension in php and use the phpoci8 extension to share with you the Operation class Oracle_db.class.phpphpclassOracle_db {public $ link; publicfunction _ construct () {$ thi try the oci8 extension in php, try phpoci8 extension
I would like to share with you a php operation class on 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');} 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 );}//}
The above is all the content of this article. I hope you will like it.
Tips: I will share with you a php Oracle operation class Oracle_db.class.php phpclass Oracle_db {public $ link; public function _ construct () {$ thi...