我有以下功能:奇怪的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_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-13 20:03:52
'$ column_to_go_by'中填充了什麼樣的值? – 2011-05-13 20:04:03
開發和生產之間的PHP版本和錯誤處理配置是否相同? – mellamokb 2011-05-13 20:04:29