奇怪的PHP错误:函数无法识别自己的参数
发布时间:2020-12-13 22:30:35 所属栏目:PHP教程 来源:网络整理
导读:我有以下功能: 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_bun
我有以下功能:
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行. 解决方法
你确定你正确地传递了两个变量吗?
方法调用如下: updateCustomerInternetBanking(999); 会产生这种错误. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |