2010-10-04 66 views
0

我有一个方法,这里面查询:的Propel/symfony的:问题一个标准

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()的参数的类名,希望同样的错误,但是......错误是不一样的..!

Fatal error: Class 'SediBlaBlaI18nPeer' not found in /home/javier/Aptana_Studio_Workspace/cashgold/lib/model/SediI18nPeer.php on line 25

任何想法是什么问题?

哈维

回答

0

在错误消息基表或视图未找到:1146表 'cashgold_new.sedii18n'

检查你有一个DB /模式称为cashgold_new含表sedii18n

顺便说一句你的查询很奇怪。 是不是等于select * from sedii18n