【问题标题】:PDO not reading config correctlyPDO 未正确读取配置
【发布时间】:2009-09-06 09:31:01
【问题描述】:

我不确定问题出在哪里,我从 Zend Framework 继承了一些代码,它使用 Propel 进行数据库查询。我已经更改了配置文件以在其中包含正确的值、用户名、密码、localhost 和 dbname,但是,每当站点必须进行数据库调用时,它就会因以下消息而死:

Error processing connection attributes for datasource [pe] [wrapped: Invalid PDO option/attribute name specified: PDO::PROPEL_ATTR_CACHE_PREPARES]

任何帮助将不胜感激,这让我发疯了。

【问题讨论】:

  • 您应该添加生成错误的代码。
  • 查询数据库时出现该错误。我可以说,加载登录页面很好,直到我输入详细信息。然后它会显示此消息。

标签: php zend-framework pdo propel


【解决方案1】:

您是否将其指定为PDO::PROPEL_ATTR_CACHE_PREPARES? 它应该是PropelPDO::PROPEL_ATTR_CACHE_PREPARES 或只是PROPEL_ATTR_CACHE_PREPARES

【讨论】:

  • 如何检查这些?在 /config/propel.php 文件中有一行说: array ( 'PROPEL_ATTR_CACHE_PREPARES' => array ( 'value' => true, ), ),
  • 如果我从 propel.php 文件中删除整个属性键,它将停止显示该错误。然后显示: Call to undefined method Criteria::hasSelectClause() in /home/richard/application/models/om/BaseDomainPeer.php on line 374
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-10-18
  • 2012-08-02
  • 1970-01-01
  • 1970-01-01
  • 2021-01-05
  • 2015-08-20
相关资源
最近更新 更多