dongxian7489 2015-12-31 14:07
浏览 107
已采纳

Yii2 Oracle PDO

I have the following in my php.ini file

extension=php_oci8_11g.dll

extension=php_pdo_oci.dll

When I run phpinfo() I get the following back:

enter image description here

Does PDO_OCI being blank mean i'm missing something - if so what?

Whilst going through Yii docs (http://www.yiiframework.com/doc-2.0/yii-db-connection.html) it says

Connection represents a connection to a database via PDO.

My queries have worked fine until, I've tried to use bindParam(). In which now I get Class 'app\models\PDO' not found as an error?

I have just ran if(class_exists("PDO")) and it returned true.

  • 写回答

1条回答 默认 最新

  • douqian9729 2016-01-04 13:45
    关注

    I spent some time on gitter and looking into it. It does seem that I need to namespace PDO to run these queries as Ryan mentioned

    So declare in the model.

    use PDO;

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效