duan01203 2011-12-19 13:18
浏览 35

CakePHP问题:对数据库的意外调用

A question for the CakePHP community:

I am attempting to upgrade a website built using CakePHP 1.3.11 to CakePHP 2.0.4. It is a very simple site with no database attached, I wish to use the PagesController / PageModel to validate the data passed to it from a Form and then send an E-Mail based on the information supplied.

The $useTable variable in PageModel has been set to false and the database.php $default is left as.. well, default (the reasoning being i dont need a database conneciton at anytime).

The problem comes in, when I try loading the view, i get:

Error: SQLSTATE[28000] [1045] Access denied for user 'user'@'localhost' (using password: YES) requires a database connection.

Why would it give me this when at no time do i want a call to any database? Worked fine in 1.3.11, am I missing something...? Hope I explained the dilemma adequately. Any input would be much appreciated.

  • 写回答

2条回答 默认 最新

  • doulan6245 2011-12-19 13:25
    关注

    It seems that you need to create a dummy datasource if you are not using any database.

    I have never done this, but this thread looks promising: http://groups.google.com/group/cake-php/browse_thread/thread/1254d64d4b21b24c

    评论

报告相同问题?

悬赏问题

  • ¥15 yolov8边框坐标
  • ¥15 matlab中使用gurobi时报错
  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真