Unusual PHP error: function does not recognize its own parameter

I have the following function:

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

When I try to run it during development, it works great. When I try to run it during production, I get the following:

 PHP Notice: Undefined variable: column_to_go_by in /var/www/mcif/lib/model/doctrine/ImportBundle.class.php on line 655 

How can $column_to_go_by be undefined ?!

And so that you know, this code is copied directly from production, and I checked that line WHERE ... is line 655.

+4
source share
1 answer

Are you sure you are using both variables correctly?

The method call is as follows:

updateCustomerInternetBanking (999);

will create such an error.

+1
source

All Articles