Propel/symfony:标准问题

发布于 2024-09-26 05:48:26 字数 1443 浏览 2 评论 0原文

我在一个方法中有这个查询:

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;

}

当我调用该方法时,我得到下面的 symfony 错误,下面存在很困难的 cashgold_new.sedii18n..:

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 行

知道问题出在哪里吗?

哈维

I have this query inside a method:

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;

}

When i call the method i get the symfony error below tough cashgold_new.sedii18n exists..:

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);

To debug it i have changed the class name of the argument of getConnection(), expecting the same error, but...the error is not the same!..:

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

Any idea whats the problem?

Javi

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若沐 2024-10-03 05:48:26

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

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

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

Following the error message Base table or view not found: 1146 Table 'cashgold_new.sedii18n'

Check that you have a DB/schema called cashgold_new containing a table sedii18n

BTW your query is very strange.
Isn't it equivalent to select * from sedii18n ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文