dongmaopiao0901 2013-10-31 08:48
浏览 47
已采纳

Kohana 3.3不使用MySQLi驱动程序

I'm working on a project that uses Kohana 3.3. I've run into a problem where I want to connect to a database. The application is telling me it's using MySQL and it's decrepated.

To solve this I've downloaded a MySQLi driver for Kohana 3.3 and followed the instructions (creating a mysqli folder in the modules folder and adding a new line in bootstrap.php to enable it).

However when I try to perform any database actions it still says it's using MySQL. The error reads: "Database_Exception [ 8192 ]: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead".

The line I'm using to enable the module is 'mysqli' => MODPATH.'mysqli', // MySQLi support for Kohana

The MySQLi driver I'm using is this (links to github).

Can anyone see what's going wrong?

Thanks in advance.

  • 写回答

2条回答 默认 最新

  • dongpo2014 2013-10-31 23:18
    关注

    Just enabling the module isn't enough.

    Since Kohana 3.3 the autoloader is case sensitive, so MODPATH/mysqli/classes/kohana/database/mysqli.php should become MODPATH/mysqli/classes/Kohana/Database/MySQLi.php for example.

    You have to edit your APPPATH/config/database.php and set the driver to 'MySQLi' or set Database::$default to the correct default database instance name. (The one using 'MySQLi' as the driver.)

    And just to be sure, do NOT edit config files outside of APPPATH. Instead, copy the file to APPPATH and edit that file. You generally should not have to edit files outside of APPPATH. Updating modules to work with a new version is allowed of course. But config files outside of APPPATH should serve as examples/blueprints.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里