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;
}
当我调用该方法时,我得到下面的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
出现错误消息未找到基表或视图: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 tablesedii18n
BTW your query is very strange.
Isn't it equivalent to
select * from sedii18n
?