gpt4 book ai didi

php - 奇怪的 PHP 错误 : function not recognizing its own parameter

转载 作者:可可西里 更新时间:2023-10-31 23:43:47 25 4
gpt4 key购买 nike

我有以下功能:

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

会产生这种错误。

关于php - 奇怪的 PHP 错误 : function not recognizing its own parameter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5997136/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com