我有以下功能:
public function updateCustomerInternetBanking($value, $column_to_go_by)
{
$sql = "
UPDATE customer c
JOIN account_import ai ON c.account_import_id = ai.id
JOIN generic_import gi ON ai.generic_import_id = gi.id
JOIN import_bundle ib ON gi.import_bundle_id = ib.id
SET has_internet_banking = 1
WHERE c.".$column_to_go_by." = ".$this->quote($value)."
AND ib.id = ".$this->quote($this->getId())."
";
$conn = Doctrine_Manager::connection();
$conn->execute($sql);
}当我尝试在开发中运行它时,它工作得很好。当我尝试在生产环境中运行它时,我得到的结果是:
PHP Notice: Undefined variable: column_to_go_by in /var/www/mcif/lib/model/doctrine/ImportBundle.class.php on line 655$column_to_go_by怎么可能是未定义的?!
如你所知,这段代码是直接从生产环境中复制过来的,我检查了WHERE...第655行。
发布于 2011-05-14 04:16:34
你确定你正确地传递了两个变量吗?
像这样的方法调用:
updateCustomerInternetBanking(999);
会产生这样的错误。
https://stackoverflow.com/questions/5997136
复制相似问题