【问题标题】:Propel/symfony: problem with a criteria推进/symfony:标准问题
【发布时间】:2010-10-04 21:27:27
【问题描述】:

我在方法中有这个查询:

public static function pincopalla(){

     $con = Propel::getConnection(SediI18nPeer::DATABASE_NAME);

     $sql = "select * from sedii18n where culture = :country
     UNION
     select * from sedii18n where culture <> :country";


     $stmt = $con->prepare($sql);

    $result = $stmt->execute(array(':country' => 'eu'));

    return $result;

}

当我调用该方法时,我得到了以下严重 cashgold_new.sedii18n 存在的 symfony 错误..:

500 | Internal Server Error | PDOException
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cashgold_new.sedii18n'    doesn't exist
stack trace

* at ()
  in SF_ROOT_DIR/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/DebugPDOStatement.php line 99 ...
          96.     public function execute($input_parameters = null)
          97.     {
          98.         $debug    = $this->pdo->getDebugSnapshot();
          99.         $return    = parent::execute($input_parameters);
         100.         
         101.         $sql = $this->getExecutedQueryString();
         102.         $this->pdo->log($sql, null, __METHOD__, $debug);

为了调试它,我更改了 getConnection() 参数的类名,期待同样的错误,但是......错误不一样!..:

致命错误:类 'SediBlaBlaI18nPeer' 未在 /home/javier/Aptana_Studio_Workspace/cashgold/lib/model/SediI18nPeer.php 第 25 行

知道是什么问题吗?

贾维

【问题讨论】:

    标签: symfony1 criteria propel


    【解决方案1】:

    以下错误消息找不到基表或视图:1146 表'cashgold_new.sedii18n'

    检查您是否有一个名为 cashgold_new 的数据库/架构,其中包含一个表 sedii18n

    顺便说一句,您的查询很奇怪。 不就相当于select * from sedii18n吗?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-03
      相关资源
      最近更新 更多