使用Thinkphp 与 oracle11g 的连接和基本操作


使用Thinkphp 与 oracle11g 的连接和基本操作
config .php 配置文件

<?php
return array(
        
        'DB_TYPE' => 'oracle',  
        'DB_HOST' => 'localhost',  
        'DB_NAME' => 'orcl', 
        'DB_USER' => 'system', 
        'DB_PWD' => 'Oracle123', 
        'DB_PORT' => '1521', 
        'DB_PREFIX' => '' 
) 
;
操作Oracle数据库
<?php
namespace Home\Controller;
use Think\Controller;
class OracleController extends Controller {
    public function index(){

        $stu_model=M('scott.dept');
        $total= $stu_model->select();
		print_r($total);
        }
}







posted @ 2018-01-01 12:55  孙中明  阅读(189)  评论(0编辑  收藏  举报